35 ms·
That's called a trampoline, and is one of the ways to simulate tail recursion. It requires a global modification to the code: you have to rewrite all your code
by noelwelsh 8y ago
That's called a trampoline, and is one of the ways to simulate tail recursion. It requires a global modification to the code: you have to rewrite all your code that you want to be stack-safe to be trampolined. It wouldn't call that trivial, but then Node developers are happy to rewrite their code into CPS so what do I know.
- gpderetta 8y agoat the end of the day it is always continuations all the way down.