I think that tail call optimizations need to be guaranteed only where a lot of recursion is anticipated or required; that is, in languages that encourage or enforce a functional programming style. (With these kinds of languages, you may find that for
or while
loops are either strongly discouraged, perceived as inelegant, or probably even completely absent from the language, so you would resort to recursion for all these reasons, and probably more.)
The C programming language (IMHO) clearly was not designed with functional programming in mind. There's all kinds of loop constructs that are generally used in favour of recursion: for
, do .. while
, while
. In such a language, it wouldn't make much sense to proscribe tail call optimization in a standard, because it's not strictly required to guarantee working programs.
Contrast this again with a functional programming language that doesn't have while
loops: This means you will need recursion; which in turn means that the language must make sure that, with many iterations, stack overflows won't become a problem; thus the official standard for such a language might choose to proscribe tail call optimization.
P.S.: Note a slight flaw in my argument for tail call optimization. Towards the end of, I mention stack overflows. But who says that function calls always require a stack? On some platforms, function calls might be implemented in a totally different way, and stack overflows would never even be a problem. This would be yet another argument against proscribing tail call optimization in a standard. (But don't get me wrong, I can see the merits of such optimizations, even without a stack!)