Skip to content
@kaappi

Kaappi Scheme

A Scheme Programming Language Implementation Written in Zig

Kaappi — R7RS Scheme, brewed in Zig

A complete R7RS-small Scheme implementation with an LLVM native compiler, C FFI, OS threads, and a curated package ecosystem.

Get Started · Procedures · Ecosystem · Playground · Docs


The runtime

kaappi/kaappi is the core interpreter — written in Zig, implementing every identifier from R7RS Appendix A plus all 14 standard libraries and a broad set of SRFIs. The LLVM native backend compiles Scheme to standalone binaries on AArch64/x86_64. First-class call/cc, hygienic macros, green fibers, OS threads, a stepping debugger, a profiler, and a sandbox mode are all included.

Ecosystem packages

Installable via thottam, the Kaappi package manager.

Package What it does
kaappi-http HTTP/1.1 client and server (pre-fork, threaded)
kaappi-web Web framework — routes, middleware, JSON helpers
kaappi-pg PostgreSQL client (libpq, parameterized queries, cursors)
kaappi-redis Redis client (RESP2, pipelining, pub/sub)
kaappi-json RFC 8259 JSON parser and serializer
kaappi-net TCP/TLS networking (shared by http, redis, pg)
kaappi-sqlite SQLite bindings (DB-API, parameterized queries)
kaappi-crypto Cryptography (OpenSSL — hashing, HMAC, random)
kaappi-email Email (MIME construction, SMTP)
kaappi-cli CLI framework — arg parsing, subcommands, auto help

Plus csv, yaml, toml, log, template, test, and bdd.

Quick taste

(import (scheme base) (scheme write))

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

(display (fib 30))  ;=> 832040

Learn by example

kaappi-examples — 12 runnable programs from beginner to advanced. Pure Scheme examples need zero setup beyond the kaappi binary.

Example What it does Difficulty
Sorting Algorithms Functional quicksort & merge sort with higher-order abstractions Beginner
Game of Life Conway's automaton — functional grid updates, ANSI animation Beginner
Maze Solver DFS generation & solving with immutable state Intermediate
Huffman Coding Compression with binary trees and prefix codes Intermediate
Symbolic Differentiation Symbolic calculus with AST walking and algebraic simplification Advanced
Metacircular Evaluator Scheme interpreting Scheme — the classic eval/apply loop Advanced
Lazy Evaluator Normal-order evaluation with memoizing thunks Advanced
REST API Full web server with PostgreSQL, Redis caching, JSON Advanced
git clone https://github.com/kaappi/kaappi-examples.git
kaappi kaappi-examples/game-of-life/app.scm demo
kaappi kaappi-examples/metacircular-evaluator/app.scm demo

Platforms

macOS aarch64 Linux x86_64 Linux aarch64 Linux riscv64 WebAssembly
Build + tests yes yes yes yes yes
Native compiler AArch64 x86_64 AArch64

Get involved

GitHub Discussions — ask questions, report bugs, propose features, or say hello. Issues and PRs are open to org members; ask for an invite in Discussions when you're ready to contribute.

Links

  • Documentation — user guide, procedure reference, ecosystem docs
  • Playground — browser REPL powered by kaappi.wasm
  • Tour — 12-lesson guided tour with live code
  • Community — how to participate

MIT License — built with Zig

Pinned Loading

  1. kaappi kaappi Public

    Kaappi: A Scheme Programming Language Implementation Written in Zig

    Zig 12 1

  2. kaappi-examples kaappi-examples Public

    Example applications for Kaappi Scheme

    Scheme

  3. kaappi-web kaappi-web Public

    Web framework for Kaappi Scheme — routing, middleware, JSON helpers

    Scheme 1

  4. keps keps Public

    Kaappi Enhancement Proposals (KEPs)

    TLA

Repositories

Showing 10 of 32 repositories

Top languages

Loading…

Most used topics

Loading…