Posts tagged #rust
-
Hardening risp's HTTP stack: TLS behind a flag, try/catch as a 30-line builtin
How risp, a zero-dependency Rust Lisp, gained production HTTP: TLS behind a Cargo flag, try/catch as a 30-line builtin, and a quadratic read loop made linear.
-
An HTTP/1.1 client and server in risp, a zero-dependency Lisp in Rust
risp — a zero-dependency Lisp in Rust, not the 2019 tutorial — gains a full HTTP/1.1 client and server written almost entirely in Lisp, with zero external crates.
-
Learn Rust by reading risp, a real Lisp interpreter (not another toy project)
risp, a zero-dependency Rust Lisp, ships a learn/ directory: file-by-file order (error.rs to eval.rs) and 19 lessons, each pinned to a real file and line.
-
Why risp's standard library is written in risp, not Rust
A deep dive into the native/Lisp boundary in risp — a flat table of std-only builtins, an int-preserving numeric tower, and why map/filter/fold are defined in a risp prelude rather than in Rust: a native higher-order builtin would re-enter the evaluator on the host stack and could overflow.
-
Why risp, a native-compiling Lisp, loses to CPython on map/fold: allocation, not codegen
risp, a zero-dependency Rust Lisp, beats CPython by 9–40× on integers but loses 3× on map+fold — the bottleneck is ~400,000 cons-cell allocations, not dispatch.
-
Lexical scope in a Rust Lisp: environments, closures, and a two-path drop
A deep dive into risp's scope model — an Rc<RefCell<Environment>> chain, iterative lookup and set!, closures that capture frames by reference, and a fast/slow Drop that frees a million-deep scope chain without recursing or allocating on the hot path.
-
Writing a Lisp reader in Rust: from text to a Value tree
A deep dive into risp's reader — a Lisp-agnostic tokenizer, an iterative explicit-stack parser that can't overflow on deep nesting, reader-macro desugaring, dotted-pair handling, and an atom classifier that declines ambiguous numbers instead of guessing.
-
Building a Lisp interpreter in Rust with Claude Code
How I built risp — a zero-dependency Lisp in Rust with a tree-walker, a bytecode VM, and a Cranelift JIT — pairing with Claude Code, and the differential-testing discipline that keeps AI-written systems code honest.
-
Adding a Cranelift JIT that runs 10–23× faster than CPython
A deep dive into risp's opt-in Cranelift JIT in Rust: a decline-don't-guess type checker, lowering if/cond/let to Cranelift IR, inline signed-overflow detection, tail-calls as loop back-edges, and a deopt guard — beating CPython by 10× to 42×.
-
How a bytecode VM in Rust beat CPython 3.14
Eleven profile-guided steps with real Rust: lexical-addressed locals, unboxed i64 arithmetic, an unsafe hot loop, and self-tail-calls in place — taking a tree-walking Lisp from 1682 ms to 95 ms on fib(30) and past CPython on every loop.
-
Designing a Lisp interpreter in Rust with no stack overflows
A deep dive into risp's iterative core — the Value enum, a hand-written iterative Drop, and an explicit-stack CEK evaluator that read, print, compare, free, and evaluate a million-deep structure without overflowing the Rust stack.