lumbda

feedback as a primitive

Lumbda names a Lisp/Scheme-derived language carrying four independently implemented execution backends — one surface syntax, one test suite. A Python tree-walker with an optional bytecode VM, a C implementation that adds an x86_64 JIT, and a pure x86_64 GNU asm interpreter (~6,600 lines, ~23 KB stripped, zero external dependencies). Every backend runs a shared .lsp source byte-identically, with full first-class continuations, exact rationals, records, and hygienic macros.

Get it

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
./asm/lumbda < examples/fibonacci.lsp

Five tiers, one language

TierLinesBinaryWhat a tier buys
Python interpreter + bytecode VM3,743—REPL hackability, debugging, reference
C tree-walker + bytecode VM9,164~215 KBdeep recursion, production workloads
C + x86_64 JIT+patches~215 KB7–10× faster than CPython on recursive workloads
Pure x86_64 GNU asm6,645~23 KBzero-dependency boot, auditability, embedded
GNU asm + naive mark-sweep GC + meta-GC arena(same source, GC_NAIVE=1)~27 KBbounded memory without manual arena discipline
WebAssembly (wasm)——sandboxed execution, Python/C/WebAssembly Text Format source tiers

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.

Whitepaper

Full language reference, tier-by-tier architecture, benchmarks, meta-GC design, universality proof.

Read in browser (HTML) Download PDF (~2.7 MB)

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 three tiers compiled to WebAssembly — Python (Pyodide hosting lumbda.py), C (Emscripten), and a hand-written WebAssembly Text Format parallel to asm/lumbda.s. Pick a demo, pick a tier (or race all three at once), and watch the same Lisp source evaluate three 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. 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 three 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