News for hackers. Stuff that matters.
Re:All you need to know about calling conventions in program... by silentbicycle on Wednesday April 20, 2011 @08:14AM (#2466245)
In his summary of tail call optimization, he doesn't make it clear that TCO is especially useful with mutually recursive functions. If you have eight different functions that tail call to each other (in a state machine, say), you can still do so in constant space. Doing that without TCO usually leads to inlining every state's code, and then a big switch statement or lots of GOTOs.

Tail-call optimization makes function calls more expressive. THAT's why they matter.

Any complaining that they lose debugging info strikes me as a bit weird. So do for / while loops, and leaf calls in procedures. So what? If you need logging, add logging.

There are no comments on this comment yet.