Continuation is to be continued
summary
Explains that Ruby’s call/cc uses memcpy plus setjmp/longjmp to copy whole stacks and that makes DSL backtracking awkward; implements a backtracking DSL (Haskell list-monad style) by transplanting shift/reset with a thread-local continuation stack into Ruby, which limits copied frames and lets bind use flat_map-style continuations. A metaprogrammed interpreter runs ~0.5s versus a 0.14s pure-list version (≈3× slower), while the shift/reset prototype is faster and a CRuby native extension is added though full benchmarks are pending.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:01What is continuation
- 6:12DSL with callcc
- 12:43Problems with callcc
- 19:16Shift-reset explained
- 26:39Summary and future








