2 ms·
> compilers often execute recursive algorithms with an explicit stack anyway. Threading compilers shouldn't be too bad, but anything more complex would need a
by rbanffy 3y ago
> compilers often execute recursive algorithms with an explicit stack anyway.
Threading compilers shouldn't be too bad, but anything more complex would need a lot of extra work. I once implemented recursion using an array for a fake stack and the return stack for the "function", but it was a lot to wrap my then young mind around. I can no longer figure out how I did it.