kaappi R7RS Scheme, brewed in Zig

Write the lambda. Run on the metal.

A complete R7RS-small Scheme implemented in Zig. Hot functions JIT-compile to native AArch64 and x86_64 — so the source stays elegant and the machine stays busy.

curl -fsSL https://kaappi-lang.org/install.sh | bash
600+ procedures 69 SRFIs first-class call/cc C FFI OS threads web · databases · email · crypto
The full pour

Everything R7RS asks for, and the parts that make it fun.

Every identifier from Appendix A is implemented — then continuations, a JIT, and an FFI on top.

conformance

Complete R7RS-small

600+ built-in procedures, 33 syntax forms, all 14 standard libraries — every identifier from Appendix A.

control

First-class continuations

Multi-shot call/cc via stack copying, plus dynamic-wind and call/ec for escapes.

speed

JIT to native code

Hot functions compile to AArch64 — inline fixnum arithmetic, comparisons, car/cdr, and cons.

batteries

69 SRFIs

Lists, strings, hash tables, vectors, threads, formatting, char-sets — 8 built in, 43 portable.

interop

C FFI with callbacks

Call shared libraries from Scheme, and pass Scheme procedures where C expects a function pointer.

concurrency

OS threads & fibers

Real OS threads via SRFI-18, plus green fibers with channels. Pre-fork and threaded HTTP servers.

Strong by the cup

The JIT earns its keep.

(fib 35) 9227465

Pure recursion, fixnum arithmetic. Kaappi outpaces Chibi and runs neck-and-neck with Gauche — with native compilation still closing the gap on the AOT compilers. See all benchmarks →

Chibi
3.5 s
Kaappi
1.9 s
Gauche
1.8 s
Chez
0.15 s
Taste it

Small forms, full language.

Run these yourself in the browser playground — no install needed.

recursion
(define (fib n)
  (if (< n 2) n
      (+ (fib (- n 1))
         (fib (- n 2)))))

(fib 30)  ;=> 832040
hygienic macros
(define-syntax my-when
  (syntax-rules ()
    ((_ test body ...)
     (if test
         (begin body ...)))))

(my-when #t
  (display "hello"))
libraries
(define-library (math)
  (export square cube)
  (import (scheme base))
  (begin
    (define (square x)
      (* x x))
    (define (cube x)
      (* x x x))))
Read on

Documentation

Brew a REPL and start evaluating.

Or try it in the browser first.