4 ms·
All true. A modified C compiler could be built that would do TCO. But, for this kind of application, it would mean that you'd have to re-validate your compile
by AnimalMuppet 10y ago
All true.
A modified C compiler could be built that would do TCO. But, for this kind of application, it would mean that you'd have to re-validate your compiler, so that's pretty much not going to happen.
- Jtsummers 10y agoLooking it up, it seems that GCC (at least) presently does do (at some optimization levels) tail call elimination. Others probably do as well. I guess I've never looked it up because it was never relevant (if I'm using C, I might as well use for loops, they're at least as clear as the equivalent tail recursive function).