Interpreter Dispatch: Switch, Computed Goto, and Tail Calls
Trace a small virtual machine through branches and loops, then compare switch, computed goto, and tail-call dispatch without changing its bytecode semantics.
8 min readConcept
Explore machine learning concepts related to Control Flow. Clear explanations and practical insights.
Trace a small virtual machine through branches and loops, then compare switch, computed goto, and tail-call dispatch without changing its bytecode semantics.
Follow direct-style and CPS factorial through the same calculation. See how closures carry pending work, why Python still grows call depth, and where trampolines fit.
Step through mutual recursion and a Call/Done trampoline to see deferred work, bounded worker depth, base cases, and the allocation tradeoff.