31 points · by denzil_correa · 14y ago · 8 comments
First, the term "tail recursion" is overly narrow. This transformation should apply to all tail calls, not just recursive ones. This is useful, for example, in families of mutually recursive functions.
Second, this transformation is not really an optimization, as it changes the behavior of some programs (by preventing stack overflow or memory allocation errors). It's a documented feature of languages (or specific implementations of languages) that users rely on to write programs in a particular style.
I prefer the term "tail call elimination" to describe these transformations.
This makes me wonder if Visual Studio's F# mode could help detect common errors, e.g. highlight recursive calls not made in tail position.
On the other hand, this could get annoying as such calls are often not a real problem in practice.