… is a fast Scheme interpreter.

git clone https://github.com/pinecone/JetScheme.git
cd JetScheme
make test
build/jet some-file.ss
build/jet --help

Benchmarks

make ab-cross-bench   # jet and rivals all built with -O2
runtime in ms
commit 0e60a80โ†—
๐ŸŽ MacBook Air (Apple M5)๐ŸŽฎ Steam Deck OG (AMD Zen 2)
jetlua5.5python3.14jetlua5.5python3.14
cdjs60111163158357354
deltablue84137234252559559
richards70128197188284401
nbody2493646025278981300
tak120259444299618863
json88143150259396312
fib1352485073647061103
splay2644426113468
overall jet isโ€ฆ1.75ร— faster2.60ร— faster1.90ร— faster2.06ร— faster

Docs

Language

The language tracks R7RS-small with the following deviations:

All numbers are 64-bit doubles. No exact/inexact tower, no rationals, no bignums. exact? is true for integral doubles. integer? likewise.

Strings and characters are byte-level. Storage is UTF-8; string-length, string-ref, string-set!, char->integer are byte-indexed. Bytewise compare gives correct codepoint order on valid UTF-8. Char predicates, char-upcase/-downcase, string-upcase/-downcase are ASCII-only.

SRFI

SRFI 1. first, second, third, fourth, fifth, take, drop, last, concatenate, fold, fold-right, reduce-right, filter.

SRFI 60. bitwise-and, bitwise-ior, bitwise-xor, bitwise-not, arithmetic-shift. Operate on integral doubles.

Structs

struct, isa?. Each (struct ...) call yields a distinct type, even when invoked twice with the same name and field list.

(define point (struct 'point '(x y)))            ; create a fresh type
(define p (point 3 4))                           ; call the type to construct
(isa? p point)                                   ; => #t
(ref p 'x)                                       ; => 3
(setf! (ref p 'x) 10)                            ; mutate field

Places

ref. (ref v i) is a polymorphic accessor. It works on vectors and strings (integer index) and structs (symbol field name).

setf!. Mutates the place denoted by its first argument:

(setf! (ref v 3) 'x)                             ; vector-set!
(setf! (ref s 0) #\H)                            ; string-set!
(setf! (ref pt 'x) 99)                           ; struct field mutation

OS env

argv. Vector of strings holding the script's command-line arguments (excluding the binary and script path).

$JET_PRELUDE/lib/prelude.ss is the bundled prelude, auto-loaded unless --no-prelude is given.

Impl

JetScheme leans heavily on techniques described in: