Folds 76 commits of substance since 2026-04-24 into the whitepaper without losing any of the novel cross-domain glue the language earns its keep on. Additions - §4.3 extended from four scopes to five, with bend as feedback across heterogeneous compute (host ↔ GPU). New diagram diagrams/five-scopes-feedback.png stacks the boundaries. - §11.8 Bend: cross-tier GPU dispatch. Wire modes (S-exp text, BSHK binary), worker hosting per tier, spawn-process-stdio + flush-port cross-tier IPC, worker health heartbeat with VRAM-ranked pick, 6-row catalog of live forms (cuda-shake-fanout, cuda-secp256k1-mul, cuda-bignum-cgbn, cuda-radix-sort, cuda-blake3-tree, cuda-sim-ops-bin). New diagram diagrams/bend-dispatch.png. - §2.1 C-tier bignum: arbitrary-precision integers (Boehm-GC managed), which unblocked the secp256k1 widths the GPU forms need on the host side. - §12.1 post-cycle audit: recv-exact O(n²)→O(n), asm scheme_read overflow, asm gc_sweep page-fault, C-tier JIT cur_code restore across CALL/RETURN. - §13 GPU Phase 1 moved from future to shipped; Phase 2 trampolining and Phase 3 interaction combinators sharpened. - Source repo link (git.unturf.com/engineering/unturf/lumbda) added to the cover page band and the Citation block. Compressions (no novel glue dropped — audited per fox's constraint) - §8.2-§8.5 EML derivation prose collapsed into a single §8.2 derivation chain code block; §8.6 renumbered to §8.3. - §6.6.3 adaptive-meta-GC narrative compressed; result table kept. - §7.4.1 GC-build S-expression portal tightened to two paragraphs; "language is its own wire format" insight kept. Preserved in full per audit - §7.5 portable RNG state across tiers - §7.5.1 one-side kernel entropy + portable bit-identical continuation - §11.7 sendfile + adaptive preload (27 KB asm-gc within 2% of Caddy) - §6.6.1 collaborative arena + mark verifier - §6.6.5 precise block typing - §8.1 + §8.3 Lumbda hosts its own EML proof checker, ~16× faster than Lean cold Net RST: 1622 → 1655 lines. |
||
|---|---|---|
| .. | ||
| tickets | ||
| asm-architecture.dot | ||
| asm-architecture.png | ||
| benchmark-ack.dot | ||
| benchmark-ack.png | ||
| benchmark-binary-size.dot | ||
| benchmark-binary-size.png | ||
| benchmark-fib.dot | ||
| benchmark-fib.png | ||
| benchmark-gc.dot | ||
| benchmark-gc.png | ||
| benchmark-speedup.dot | ||
| benchmark-speedup.png | ||
| benchmark-sumto.dot | ||
| benchmark-sumto.png | ||
| bend-dispatch.dot | ||
| bend-dispatch.png | ||
| c-architecture.dot | ||
| c-architecture.png | ||
| five-scopes-feedback.dot | ||
| five-scopes-feedback.png | ||
| gpu-architecture.md | ||
| jit-pipeline.dot | ||
| jit-pipeline.png | ||
| meta-gc-policy.dot | ||
| meta-gc-policy.png | ||
| python-architecture.dot | ||
| python-architecture.png | ||
| README.md | ||
lumbda Architecture Documentation
"A diagram is worth 10,000 words." — russell@unturf.com
Three implementations of the same Scheme language, sharing the same .lsp test files.
Python Implementation (lumbda.py)
3,324 lines. Bytecode compiler + stack VM + full continuations + portal.
Execution tiers:
- Tree-walker (
leval): default, handles all forms including macros - Bytecode VM (
--fast): 40 opcodes + superinstructions, 7-19x faster - Python JIT prototype: exec()-based transpilation (labeled as prototype)
Key features:
- Full multi-shot continuations via explicit frame stack
- Portal: serialize VM state to JSON, resume on another machine
- Inline cache, constant folding, peephole optimizer
- Source maps for error reporting with line numbers
- Bytecode serialization (.lspc files)
Tests: 571 unit + integration tests (tests.py)
C Implementation (c/)
8,120 lines. Tree-walker + bytecode VM + x86_64 JIT.
Execution tiers:
- Tree-walker: default, full special form support
- Bytecode VM (
--fast): matching Python's opcodes - x86_64 JIT (
--jit): 10-24x faster than CPython
Key features:
- NaN-boxed 64-bit values (zero-alloc numbers)
- Hash-map environments with parent chain + global shortcut
- Interned symbols
- Real JIT: mmap(PROT_EXEC) + raw x86_64 bytes
Tests: 76 unit + integration + JIT tests (test.c)
Assembly Implementation (asm/)
2,592 lines of GNU assembler. 13KB binary. Zero dependencies.
Design:
- No C. No libc. Only Linux syscalls (read, write, mmap, exit)
- Tag-in-low-3-bits value representation
- Bump allocator on 64MB mmap'd page
- TCO via
jmp .eval_top(never grows the stack) - 34 builtins, all special forms
Tests: 75 unit + integration + functional tests (test.sh)
JIT Pipeline (c/jit.c)
1,309 lines. Compiles Scheme AST directly to x86_64 machine code.
What gets JIT'd:
- if, cond, and, or (conditional jumps)
- +, -, *, =, <, >, <=, >= (native integer ops)
- let, let* (stack-allocated locals)
- Named-let loops (native jmp, zero call overhead)
- car, cdr, cons, null?, pair? (NaN-box pointer ops)
- Self-recursive calls (call/ret) and tail calls (jmp)
What falls back to interpreter:
- call/cc, macros, syntax-rules, quasiquote, modules
- String/vector/hash-table operations
- Any form the AST analyzer can't verify as integer-safe
Performance Summary
All benchmarks measured in-process (no startup overhead) on the same machine.
| Implementation | ack(3,4) | fib(35) | sum-to(50k) | Binary |
|---|---|---|---|---|
| C + x86_64 JIT | 0.19ms | 0.09ms | 0.55ms | 171KB |
| CPython (native) | 1.3ms | 0.006ms | 5.5ms | ~5MB |
| C interpreter | 20ms | 0.06ms | 109ms | 171KB |
| Python bytecode VM | 149ms | 0.75ms | 437ms | 3,324 lines |
| Assembly (13KB) | ~8ms* | ~0.6ms* | ~43ms* | 13KB |
*Assembly times include process startup + tokenizer + parser.
The JIT runs Scheme faster than CPython runs Python on recursive workloads: ack(3,4) is 7x faster, sum-to(50k) is 10x faster. The JIT compiles Scheme AST directly to x86_64 machine code via mmap(PROT_EXEC).
Test Coverage
943 verified assertions across all implementations:
make test-all
Python unit/integration: 571 tests
C unit/integration/JIT: 83 tests
Assembly unit/int/func: 108 tests
Shared functional: 181 tests (Python + C)
Total: 943 assertions
The language is R7RS Scheme. lumbda is the project name — a play on Common Lisp, since this is decidedly uncommon.



