An optimized fork of Joker (Clojure-like Lisp interpreter) for inclusion in gi, a self-hosted coding agent. Four execution tiers — WASM native via wazero JIT, typed IR with zero-boxing, boxed IR for collections, and tree-walker for full Clojure semantics — selected automatically per expression. Mandelbrot runs ~4200× faster than upstream; general Clojure code 10–500× faster.
The compiler analyses each expression and emits to the fastest viable tier: pure numeric loops compile to WASM bytecode executed by wazero's JIT (~0.2ms), primitive/string/cursor loops use a typed IR stack with zero boxing (~2–8ms), collection-heavy code uses a boxed IR interpreter (~10–40ms), and everything else falls through to the tree-walker for full macro/special-form/I/O support. Generic tail-call optimization, transient vectors/maps, and a native StringCursor type round out the runtime.
WASM → Typed IR → Boxed IR → Tree-walker — automatic tier selection per expression.
Pure integer/float loops compile to native code via wazero. ~0.2ms for Mandelbrot.
Primitive, string, and cursor loops on an irValue stack — no interface{} boxing overhead.
O(1) append/assoc for builder patterns — auto-promoted from persistent collections.
disassemble, analyze, wasm-diagnostic, escape-analysis, profile, benchmark, mem-stats, gc — all from Joker scripts.
joker.imaging (image processing), joker.svg (SVG generation + raster), joker.pdf (PDF documents).