Delimited Continuations in Lone Lisp
3 days ago
- #programming
- #lisp
- #continuations
- Lone Lisp now supports delimited continuations, a powerful control mechanism.
- Implementation involved converting a recursive evaluator into a register and stack machine.
- The explicit-control evaluator from SICP was adapted to Lone Lisp.
- Primitives were rewritten as state machines to avoid C stack recursion.
- Delimited continuations allow capturing and resuming the execution stack.
- The `control` and `transfer` primitives enable delimited continuations.
- Continuations can be called like functions, resuming captured stack states.
- This feature paves the way for implementing exceptions and generators.