Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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...



C 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

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!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: