4 ms·
> [Proper tail calls are] an optimization issue for most languages It's an optimization issue for no languages; it's an optimization issue for some language im
by tonyg 5y ago
> [Proper tail calls are] an optimization issue for most languages
It's an optimization issue for no languages; it's an optimization issue for some language implementations.
At the language level, it's a resource management (garbage retention) issue that leads to an expressiveness problem. See Clinger's papers on safety-for-space (e.g. [1]) and Felleisen's paper on expressiveness [2]. Support for proper tail calls in a language implementation also sometimes makes program execution faster, but that's not the main motivation.
[1] https://www.cs.tufts.edu/~nr/cs257/archive/will-clinger/proper-tail-space.pdf https://www.cs.tufts.edu/~nr/cs257/archive/will-clinger/prop...
[2] https://www.sciencedirect.com/science/article/pii/016764239190036W https://www.sciencedirect.com/science/article/pii/0167642391...