Every time I implement an interpreter with recursion, I regret it.
As soon as I want TCO, or userland control of stack limits, or resumable exceptions, I need my own stack.
This is awkward because it's an upfront design decision. Changing the stack model is a big refactoring.
miniblog.
Related Posts
I haven't used resumable exceptions much at all. I keep coming across scenarios where I wish the current language had them.
Most recent example: writing a tree-walking interpreter with a step counter. I'd love to throw ScriptExceededLimit with an option of resuming.
I am fascinated to learn that Multics (the Unix predecessor) was a big influence on the lisp condition system (i.e. resumable exceptions)!
From
Programming in the debugger: https://willcrichton.net/notes/programming-in-the-debugger/
Discusses how notebooks enable incremental program writing, and contrasts with REPLs.
Makes some interesting points regarding persistence, although resumable exceptions have similar upsides too.
