Undo all the things!
summary
Shows that undo is implemented by replaying actions not magical GC, demonstrates bpython’s undo behavior and a Haskell prototype, and explains limits: non‑deterministic syscalls, cached stdin, and accumulating temp directories. Describes using fork with copy‑on‑write snapshots and pseudo‑terminals, patching readline via LD_PRELOAD to intercept state, and adding undo to IRB. Builds a JavaScript/Python prototype with snapshots and deterministic replay so code can be edited and resumed at the last function run — it works for many REPLs but has performance and side‑effect tradeoffs.
AI-written summary · about
chapters (10)
- 0:00Undo in interpreters
- 1:07Replaying actions
- 2:09Non-deterministic actions
- 3:53Process forking for state
- 5:38LD_PRELOAD for undo
- 6:42Snapshot undo limits
- 7:23JavaScript time rewinding
- 8:48Rewind to function calls
- 9:54Undo in Scheme-like
- 10:15Demo: JavaScript spaceships








