bearophile wrote:
If D wants to become more fit for functional programming, then D
specs may talk about this, and the DMD may learn to perform part of
such optimization, and GCC does.
One of the several possible alternative solutions:
http://www.score.is.tsukuba.ac.jp/~minamide/papers/sas03.pdf
A bit of related discussion: http://lambda-the-ultimate.org/node/1331
I know how to do tail call optimization (it's a very old optimization),
but there are some technical problems with it in the back end.
In any case, tail call optimization is not necessary to do D-style
functional programming, because loops with mutable indices are practical
with pure functions.