3 ms·
I see it, certain algorithms need guaranteed tail-call elimination, otherwise they are too inefficient and must be manually unrolled or rewritten to avoid blowi
by lioeters 19d ago
I see it, certain algorithms need guaranteed tail-call elimination, otherwise they are too inefficient and must be manually unrolled or rewritten to avoid blowing the stack. So a compiler optimization that is "nice to have" is not good enough.
- clhodapp 19d agoNo algorithm requires tail-call elimination in a general-purpose language with imperative mutability. It's just another way to express iteration.
- spider-mario 19d agoSure, but mutual recursion might require `goto` for example. Or an explicit state machine.
- clhodapp 18d agoI can see how it might require an explicit state machine (keep a mutable state number and switch over the inlined bodies of what could be functions), but I'm not seeing how it could require `goto`. Are there more-complex relationships that might require it?
- spider-mario 18d agoI meant it more in the sense that “you need one or the other” rather than “some cases require one and some other cases require the other”.