3 ms·
> If you are going to require high-performance I'm not sure exactly why people bring up performance when tail call elimination is mentioned. Maybe because som
by kmill 9y ago
> If you are going to require high-performance
I'm not sure exactly why people bring up performance when tail call elimination is mentioned. Maybe because sometimes it's called "tail call optimization"? Besides replacing a call with a jump, it's more of an "optimization" in the sense that it allows an optimizing compiler to see and optimize a loop. However, CPython is not an optimizing compiler, and it would barely be an optimization.
Rather, tail call elimination is a feature that allows for a very controlled goto statement, and even a computed goto. However, "continue" and "break" seem to work well enough for most cases. Perhaps the strongest objection to having TCO is that stack traces become more inscrutable.
- flavio81 9y ago>I'm not sure exactly why people bring up performance when tail call elimination is mentioned. Yes, you are correct, however i was mentioning TCO and performance as separate topics. This nonwithstanding, consider that TCO allows writing recursive functions without utilizing call stack space, and this might have some performance impact as well.