: > Funny thing is that Java is not stuck with a stack model, yet: > implementations of Java are not required to be tail recursive. When: > will people ever learn? ... :-(

: The security manager which is part of the security API has a function: that lets the SM figure out the call chain. Some of the current: security mechanisms would conceivably break in the presence of tail: call optimizations. I think this is the main reason Java is "stuck": with the stack model for now at least.

Java is compiled to bytecode. A clever compiler would create bytecode
that has tail recursion transformed into jumps.

It is that bytecode that is then checked by the security mechanisms,
not the source code. So while the elimination of tail recursion can
possibly change the semantics of a program (if it has access to its
own call chain), it can never break the security mechanisms. And this
"change in semantics" might just be what you want.