No description
  • Scheme 72.7%
  • Common Lisp 13%
  • Rust 5.6%
  • C 5.2%
  • Shell 1.4%
  • Other 1.9%
Find a file
Jaime Fournier 425c0ae994 updates
2026-07-30 19:26:20 -06:00
.builds ci: add platform sandbox parity smoke 2026-07-28 07:30:00 -06:00
.jerboa security: harden build scanner boundaries 2026-07-28 11:30:10 -06:00
assets Add Jerboa logo assets 2026-06-18 20:52:36 -06:00
benchmarks security: add taint propagation benchmark 2026-07-27 23:24:28 -06:00
bin Add jerboa expand subcommand to emit pure Chez R6RS from a package 2026-07-21 11:00:05 -06:00
browser-repl updates 2026-07-21 11:01:47 -06:00
data updates 2026-07-30 19:26:20 -06:00
docs updates 2026-07-30 19:26:20 -06:00
etc Add Emacs major mode for Jerboa Scheme 2026-03-27 17:48:26 -06:00
examples security: default scripts to safe prelude 2026-07-27 16:59:04 -06:00
jerboa-native-rs native: export generated FFI symbols 2026-07-30 14:59:30 -06:00
lib jpkg: honor project ignore files when packing 2026-07-30 15:31:40 -06:00
lsp Implement typed plan evidence gates 2026-07-29 08:08:35 -06:00
mcp security: classify mcp scanner boundaries 2026-07-28 11:09:28 -06:00
scripts updates 2026-07-29 19:32:50 -06:00
src Implement typed plan evidence gates 2026-07-29 08:08:35 -06:00
support updates 2026-07-30 19:26:20 -06:00
tests updates 2026-07-30 19:26:20 -06:00
tools security: harden build scanner boundaries 2026-07-28 11:30:10 -06:00
vendor security: harden P0 fixes (non-ASCII ReDoS, httpd symlink, SSRF IPv6, taint format) 2026-07-22 10:51:16 -06:00
.containerignore updates 2026-07-29 19:32:50 -06:00
.gitignore updates 2026-07-19 17:49:32 -06:00
.jerboa-system Implement typed plan evidence gates 2026-07-29 08:08:35 -06:00
.jerbuild remove DuckDB native integration 2026-07-30 10:49:15 -06:00
AGENTS.md Move release distribution to SourceHut 2026-07-30 15:40:34 -06:00
AGENTS.md.example updates 2026-07-29 19:32:50 -06:00
CLAUDE.md Unify agent guidance: merge CLAUDE.md into AGENTS.md, symlink CLAUDE.md 2026-05-23 22:48:15 -06:00
Containerfile remove DuckDB native integration 2026-07-30 10:49:15 -06:00
jerbuild.ss security: harden build scanner boundaries 2026-07-28 11:30:10 -06:00
jolt.md Add browser REPL and MCP framing fixes 2026-07-17 13:05:53 -06:00
jpkg.lock security: fix all P0-P5 issues from security review 2026-07-23 20:25:34 -06:00
jpkg.sexp Update release artifacts for 0.2.0 2026-06-05 17:54:28 -06:00
LICENSE Switch to MIT license 2026-07-21 13:41:54 -06:00
LICENSE-CHEZ docs: add LICENSE-CHEZ + README Chez attribution 2026-06-02 19:52:25 -06:00
Makefile remove DuckDB native integration 2026-07-30 10:49:15 -06:00
NOTICE Ship Chez notices in Jerboa releases 2026-06-18 21:18:11 -06:00
plan.md updates 2026-07-29 19:32:50 -06:00
README.md updates 2026-07-29 19:32:50 -06:00
rust-toolchain.toml fix: harden runtime and release boundaries 2026-07-11 17:22:11 -06:00
SECURITY.md docs: consolidate repository documentation map 2026-07-28 01:00:59 -06:00
VERSION release: prepare 0.2.8 2026-07-30 11:30:50 -06:00

Jerboa

Jerboa is a Scheme dialect built on Chez Scheme. It keeps the parts of Gerbil that make day-to-day Scheme pleasant, adds a large Clojure-style data and concurrency layer, and ships a production standard library on top of native Chez code plus an optional memory-safe Rust backend.

All user-facing Jerboa code is written in .ss files:

(import (jerboa prelude))

(def (hello name)
  (displayln (str "hello, " name)))

(hello "world")

Run a file with:

jerboa run hello.ss

Do not write (library ...) forms in user code. The .sls files in this repository are implementation internals.

Quick Start

The prelude is the default way to write Jerboa. It exports the core language, common data structures, strings, lists, hashes, result types, iterators, JSON/CSV, paths, datetime, regex helpers, file I/O, pretty printing, and compatibility aliases for common Scheme names.

(import (jerboa prelude))

(defstruct point (x y))

(def (describe-point p)
  (match p
    ((? point? pt) (str "point(" (point-x pt) ", " (point-y pt) ")"))
    (_ "not a point")))

(def (main)
  (def p (make-point 3 4))
  (displayln (describe-point p))
  (displayln (sort '(5 1 3) <))
  (displayln (for/collect ([x (in-range 5)]) (* x x)))
  (displayln (-> " a,b,c " (string-trim) (string-split #\,)))
  (displayln (json-object->string '(1 2 3)))
  (displayln (unwrap (->? (ok 10) (+ 5) (* 2)))))

(main)

Important syntax note: square brackets are just parentheses, like Gerbil and Chez. Use quoted lists such as '(1 2 3) when you want a literal list.

What Jerboa Includes

At this snapshot, lib/std plus lib/jerboa contain 647 .ss modules. The prelude exports the everyday language; specialized libraries are imported from (std ...), (jerboa ...), and related module trees.

Area Highlights
Core language def, def*, defn, optional/rest args, typed parameters, defrule/defrules, define-values, sealed records, enums, active patterns, ergonomic casts, method dispatch, match/match2, contracts, try/catch/finally, with-resource, result types, threading macros, iterator macros.
Reader syntax [...] as parentheses, {method obj args} method dispatch, trailing name: keywords, :std/path imports, heredoc strings, raw strings and regex reader support, optional Clojure reader mode via #!cloj.
Prelude data Hash tables, alists/plists, list utilities, functional combinators, strings, paths, file I/O, JSON, CSV, datetime, formatting, pretty printing, regex helpers, atoms, volatiles, shared state, lightweight SQLite/TCP helpers.
Persistent and generic collections Persistent maps/vectors/sets/queues, sorted maps/sets, HAMT maps, weak collections, ephemerons, immutable values, lazy sequences, generic collection protocols, relation operations, tables, dataframes, datalog, lenses, zippers, Specter-style navigation.
Clojure compatibility Sequences, reducers, transducers, atoms, agents, refs/STM, protocols, multimethods, metadata, futures/promises/deref, EDN, walkers, zippers, nested data helpers, datafy, core.async-style CSP channels.
Concurrency Native OS threads with no GIL, atomics, mutex/condition wrappers, M:N fibers, fiber-aware events/channels, async/await, structured concurrency, work pools, resource pools, barriers, wait groups, actor systems, supervisors, distributed actors, CRDTs, Raft, STM, CSP.
Networking and web HTTP client/server, secure rustls HTTPS daemon, fiber HTTP server, WebSocket/fiber WebSocket, HTTP/2, DNS, routers, rate limiting, connection pools, sendfile/zero-copy paths, TCP/UDP/TLS/rustls, SSH, S3, SMTP, SOCKS5, gRPC, JSON-RPC, 9P, FastCGI, Rack-style web adapters, event streams.
Text and protocols JSON and JSON Schema, CSV, YAML, XML, HTML/SXML, TOML, INI, EDN, safe s-expression wire data, MessagePack, CBOR, Transit, protobuf, base58/base64/hex, UTF-8/16/32, globbing, diffs, templates, regex, native regex, PCRE2, rx, PEG parsers.
Storage and databases SQLite, PostgreSQL, DuckDB, LevelDB, DBI layer, query compilation, connection pools, mmap and mmap-btree helpers, content-addressed storage, image/closure persistence, package stores.
Native Rust backend Optional libjerboa_native bindings for ring crypto, rustls TLS, Rust HTTP request parsing, ReDoS-resistant regex, flate2 compression, rusqlite/postgres/duckdb, secure memory, epoll, inotify, Landlock, packet capture, and panic-contained FFI entry points.
Security and capabilities Audit logging, auth, cages, capability and capability-typed I/O, import audit, flow/taint tracking, IO interception, Landlock, seccomp, Capsicum, seatbelt, sandboxing, sanitizers, secret handling, privilege separation, safe/pure audit tools.
OS and runtime Environment/path/fd/signal/process modules, errno/fcntl/flock, mmap, temp files, tty, aproc, exec identity, inotify, epoll, kqueue, io_uring, platform detection, supervised services.
Typed and effect systems Typed parser/checker, Rust/LLVMIR wrappers, affine and linear types, refinement, phantom, GADT, HKT, rows, typeclasses, effect typing, deep/scoped/resource effects, contracts and chaperones.
Compiler and WASM Compiler passes, partial evaluation, PGO, specialization, staging/comptime, secure compiler/link modules, WebAssembly format/codegen/runtime/GC/sandbox/WASI modules, Slang docs and secure WASM target work.
Tooling and operations REPL/nREPL, LSP, docs generation, package manager, reproducible builds, SBOM and build verification, watch mode, logging, metrics, tracing/spans, health checks, circuit breakers, profiling, flamegraphs, heap/thread/timetravel debugging, fuzzing, QuickCheck, property tests, benchmarks.

Recent Additions

The latest standard-library push filled in several areas that the old README did not cover:

  • Concurrency and scheduling: (std misc fiber), (std misc event), (std misc custodian), (std misc delimited), enhanced (std misc pool).
  • Data structures: (std misc persistent), (std misc lazy-seq), (std misc weak), (std misc collection), (std misc relation).
  • Serialization and protocols: (std text msgpack), (std net 9p), (std misc binary-type).
  • Testing and debugging: (std test), (std test quickcheck), (std test check), (std misc profile), (std misc equiv), (std misc diff).
  • Metaprogramming: (std misc typeclass), (std misc ck-macros), (std misc fmt), (std misc chaperone), (std misc advice).
  • System utilities: (std misc config), (std misc cont-marks), (std misc terminal), (std misc highlight), (std misc guardian-pool), (std misc amb), (std misc memoize).

See docs/whats-new.md for the detailed module notes and examples.

Documentation

Use docs/index.md as the maintained map for the language repository. Stable language, library, build, and security references live at top-level docs/; dated audits and review records live under docs/reviews/.

The shortest path through the docs is:

Examples

Persistent HAMT Map

(import (jerboa prelude)
        (std misc persistent))

(def users
  (hamt-set
    (hamt-set hamt-empty 'alice 1)
    'bob 2))

(displayln (hamt-ref users 'alice #f))
(displayln (hamt-contains? users 'bob))

Property-Based Test

(import (jerboa prelude)
        (std test check))

(def sort-preserves-length
  (for-all ([xs (gen:list (gen:integer))])
    (= (length (sort xs <)) (length xs))))

(displayln (check-property 100 sort-preserves-length))

Why Chez Scheme

Jerboa uses Chez because it has the runtime properties a systems language needs:

  • Real OS threads with no global interpreter lock.
  • Thread-safe generational GC and cheap compiled closures.
  • Fast fixnum arithmetic and bytevector-heavy protocol code.
  • Stable FFI via foreign-procedure and foreign-callable.
  • A mature native-code compiler with whole-program optimization paths.
  • Apache 2.0 licensing for Chez Scheme; see LICENSE-CHEZ and NOTICE.

The repository can use stock Chez 10.x. It also vendors an additive Chez tree under vendor/ChezScheme/ for primitives the standard library can use without changing the user-facing language.

Licensing and Notices

Jerboa vendors Chez Scheme under vendor/ChezScheme/. Chez Scheme is licensed under Apache License 2.0, and its upstream NOTICE text must remain available when Jerboa source or binary artifacts redistribute Chez-derived code. Keep LICENSE-CHEZ, NOTICE, vendor/ChezScheme/LICENSE, and vendor/ChezScheme/NOTICE with source distributions. Jerboa release tarballs include the top-level notice files and a share/licenses/jerboa/ copy of the original Chez license and notice.

Reader Syntax

Jerboa extends the Chez reader with Gerbil-inspired syntax:

(let ([x 1] [y 2]) (+ x y))  ;; brackets are parentheses
{area circle}                 ;; -> (~ circle 'area)
name:                         ;; keyword object #:name
:std/net/request              ;; -> (std net request)

#<<END
multi-line string
END

Both import spellings work:

(import :std/net/request)
(import (std net request))

Gerbil and Clojure Compatibility

Most user-level Gerbil-style code works: def, defstruct, method dispatch, match, try, :std/* module paths, and square-bracket binding forms are first-class Jerboa syntax.

Jerboa is not the Gerbil expander on Chez. These do not carry over unchanged:

  • Gerbil expander internals such as :gerbil/expander.
  • Gambit ## primitives except where Jerboa provides explicit wrappers.
  • Gerbil-specific export extensions unless translated.
  • Gambit thread/runtime APIs that have no Chez equivalent.

The Clojure layer is provided as Jerboa libraries rather than by embedding Clojure. It covers the common data, sequence, state, protocol, multimethod, STM, and CSP idioms while staying inside Chez Scheme.

Build and Test

Common local targets:

make build          # build core Jerboa libraries
make binary         # native binary build for macOS/FreeBSD/other local hosts
make audit          # production security and release-readiness gate
make release-evidence # audit, SBOM, reproducibility, and release smoke evidence
make test           # core test suite
make test-features  # feature-phase tests
make test-native    # Rust native backend tests
make test-all       # broad local test run

On Linux, the release pipeline also uses:

make podman-build

For MCP tooling data and portable MCP binaries:

make jmcp
make jmcp-portable

Requirements and Platforms

  • jerboa on PATH, or bin/jerboa from a source checkout.
  • Optional Rust toolchain for libjerboa_native features.
  • Optional legacy chez-* C libraries for older wrappers that remain available while the Rust backend supersedes them.

Supported platform work in this repository covers Linux glibc/musl, FreeBSD, macOS on Intel and Apple Silicon, and Android/Termux. Security confinement maps to the strongest local mechanism available: Landlock/seccomp on Linux, Capsicum on FreeBSD, and sandbox-exec style support on macOS.

Project Structure

lib/
  jerboa/          core reader, macros, runtime, prelude, package/build glue,
                   typed wrappers, WASM support
  std/             standard-library .ss modules
jerboa-native-rs/  optional Rust shared library backend
mcp/               active Jerboa MCP server
data/              MCP cookbook, API signatures, feature and changelog data
docs/              language, library, build, security, WASM, typed, and ops docs
tests/             Jerboa test suites
benchmarks/        benchmark harnesses
tools/             generators, linters, build and audit helpers
vendor/            vendored Chez Scheme tree

Start with the canonical documentation map:

License

Jerboa is licensed under the Apache License 2.0.

Jerboa bundles a vendored copy of Chez Scheme (vendor/ChezScheme/), also under the Apache License 2.0. Its NOTICE and full license text are reproduced at LICENSE-CHEZ.