3 ms·
Yeah and they have TCO, which C doesn't. It's not recursion that is bad, it's unchecked stack growth, in environments where beancounters made sure the hardware
by brohee 12y ago
Yeah and they have TCO, which C doesn't.
It's not recursion that is bad, it's unchecked stack growth, in environments where beancounters made sure the hardware is adequate but not more...
- jacquesm 12y agoC does have tail call optimization in some instances, that's a function of the compiler and while not all of the compilers can do this some can: http://ridiculousfish.com/blog/posts/will-it-optimize.html http://ridiculousfish.com/blog/posts/will-it-optimize.html C the language does not specify how optimizing compilers should handle this situation. -O2 on gcc will get you this optimization (and many more), it will even do TCO on really hard cases, some where FP languages/compilers would fail!