lumbda

feedback as a primitive

Lumbda names a Lisp/Scheme-derived language carrying independently implemented execution backends — one surface syntax, one test suite. A Python tree-walker with a flat-slot bytecode VM, a C implementation adding a threaded stack-slot VM and x86_64 JIT, a zero-dependency Rust bytecode VM (~10,350 lines, native + wasm32-unknown-unknown), and a pure x86_64 GNU asm interpreter (~11,800 lines, ~87 KB binary, zero external dependencies). Every backend runs shared .lsp source byte-identically, with arbitrary-precision bignums, closures, tail-call optimization, and hygienic macros.

Get it

One file, every desktop: our C tier built with Cosmopolitan Libc as an Actually Portable Executable. The same lumbda.com starts on Linux, macOS, Windows, FreeBSD, NetBSD and OpenBSD, on x86-64 and ARM64, with its Boehm collector inside and nothing to install. Tested so far on Linux (x86-64, and ARM64 under qemu).

Download lumbda.com (~1.6 MB) · SHA256SUMS · build

chmod +x lumbda.com
./lumbda.com                                  # REPL
./lumbda.com -e '(display (expt 2 100))'      # one expression
./lumbda.com --jit program.lsp                # x86-64 JIT
# Windows: rename to lumbda.exe, then run it from a terminal

Or build every tier from source:

git clone https://git.unturf.com/engineering/unturf/lumbda.git
cd lumbda
make test-all

Run a program in any tier:

python3 lumbda.py --fast examples/fibonacci.lsp
./c/lumbda examples/fibonacci.lsp
./rust/target/release/lumbda examples/fibonacci.lsp
./asm/lumbda < examples/fibonacci.lsp

Seven tiers, one language

TierLinesBinaryWhat a tier buys
Python interpreter + bytecode VM7,004—REPL hackability, debugging, reference (1.7–6.1× faster flat-slot VM)
C tree-walker + bytecode VM24,243~514 KBhybrid stack-slot/upvalue VM, deep recursion, up to 18.3× faster on large workloads
C + x86_64 JIT(same source)~514 KBfastest overall tier (170.7 ms across the 6-benchmark suite)
C, Cosmopolitan (lumbda.com)(same source)~1.6 MBone file for six operating systems on x86-64 + ARM64, collector inside
Rust bytecode VM (rust/)10,354~1.2 MB native
~437 KB wasm
zero external crates, memory-safe bytecode VM, native wasm32-unknown-unknown (~160 KB gzipped), arbitrary-precision bignums
Pure x86_64 GNU asm11,786~87 KBzero-dependency boot, auditability, O(1) dispatch & self-TCO (5.9–37.6× faster)
GNU asm + naive mark-sweep GC + meta-GC arena(same source, GC_NAIVE=1)~96 KBbounded memory without manual arena discipline (246.4 ms across the 6-benchmark suite)
WebAssembly (wasm)——sandboxed browser execution across Python, C, Rust, and hand-written WAT tiers

Head-to-head 6-benchmark suite total (count(200k), sum-to(200k), fib(25), tak(15,10,6), ack(3,6), hash(5k)): C --jit 170.7 ms · C --fast 218.6 ms · x86_64 asm (gc) 246.4 ms · Rust VM 595.9 ms · Python --fast 9,645 ms.

Portal: feedback across time

A continuation carries feedback within a process. A portal carries feedback across processes. Same primitive, different scope: capture machine state, serialize, reload elsewhere, resume. Lumbda ships three portal formats with distinct trade-offs:

bend: dispatch to a GPU without rewriting your code

Wrap any registered GPU-able form in (bend …) and lumbda decides per call whether to run it locally or ship it to a CUDA worker over our wire protocol. Tiny inputs stay local; heavy inputs bend to a worker that holds a warm CUDA context across requests.

(bend (cuda-shake-fanout one-million-inputs 32))   ; → 157 ms on a 3090
                                                   ;   12× faster than host hashlib

Real workloads from the catalog: SHAKE256 fan-out (12× over host hashlib at 1 M inputs), secp256k1 batched point-mul (13.6 Mkeys/s on a 3090, ~309× coincurve CPU), tableau stabilizer sim (186× over Stim CPU, surveyed), and a quantum-reversible circuit simulator wired live to internal ECDSA research.

Read the full bend page — protocol, benchmarks, form catalog

EML universality proof

A single operator eml(x, y) = exp(x) − ln(y) with a constant 1 generates all elementary functions: exp, ln, arithmetic, negation, complex-plane access, trigonometry. Verified numerically in Python, verified in Lumbda's own bytecode, proven formally in Lean 4 with zero sorry. Lumbda's native symbolic-rewrite checker runs five theorems in 46 ms cold or 7 ms cached — roughly 16× faster than Lean's cold rebuild on identical hardware.

Whitepapers

Lumbda Whitepaper (v2, Second Edition, 26 pages) — Full language reference, four-tier architecture (Python, C + JIT, zero-dependency Rust + wasm32, pure x86_64 asm), verified cross-tier compiler breakthroughs, portals, meta-GC, and EML universality proof.

Read v2 in browser (HTML) Download v2 PDF (~3.5 MB) v1 archive (PDF)

Companion Paper: Exact Fault-Tolerant Quantum Circuit Compilation & Benchmarks (18 pages) — 276 verified non-cracking fault-tolerant circuits across quantum chemistry (SelectSwap QROM), finance & PDEs (QAE), combinatorial SAT, full 10-round FIPS 197 AES-128 Grover oracle (273 Q), and full 256-coefficient FIPS 203 ML-KEM NTT (3,096–3,110 Q), with bit-exact C / Rust / Python parity.

Read Quantum Paper (HTML) Download PDF (~1.3 MB) ecdsa.fail Live Tracker →

License

AGPL-3.0-only. Public domain for whitepapers, proofs, and disclosures through undefect.com. Companion to unturf.com’s permacomputer project.

Demo — play with the language

All four tiers compiled to WebAssembly — Python (Pyodide hosting lumbda.py), C (Emscripten), Rust (zero-dependency bytecode VM targeting wasm32-unknown-unknown), and a hand-written WebAssembly Text Format parallel to asm/lumbda.s. Pick a demo, pick a tier (or race all four at once), and watch the same Lisp source evaluate four different ways. Free-form mode saves your custom code to an encrypted local vault.

Open the playground →

REPL — persistent interactive sessions

Multi-tab REPL with one worker per tier per tab across Python, C, Rust, and asm. Defines, set!, hash-table mutations stick across evals within a session. Transcripts persist in encrypted localStorage — supply a password, reload, same password unlocks the same vault. Each input can race all four tiers at once.

Open the REPL →

DOOM — a real program on lumbda

id Software’s linuxdoom-1.10, ported line for line to lumbda Scheme and running in your browser on the C tier compiled to WebAssembly. Game code compiles to WebAssembly at run time through lumbda’s JIT, and a Boehm collector keeps memory flat while you play. Frames match native lumbda bit for bit. WASD moves, the mouse turns, click fires. Freedoom supplies the levels. GPLv2, source included.

Play DOOM →

Verify the source (undoom-src.tgz, commit b618f72f868d):
MD5 71d511b8dea3428f153bbd47b043d53f
SHA-256 93d2a3b81705f385d9372a1653c6441508175c7d1af64b4255d77d515222914a
.md5 · .sha256 · every file the demo ships: SHA256SUMS, MD5SUMS