Posts tagged #interpreters
-
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.
-
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.
-
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.
-
Macros and quasiquote: code that writes code in risp
A deep dive into risp's macro system in Rust — how defmacro, demand-driven expansion, the quasiquote engine, and gensym let a Lisp grow control structures like while and unless that no function can express.