Hacker News new | ask | show | jobs
by ectoplasm 3976 days ago
How is a "proper tail call" implemented if you aren't talking about conversion to iteration? I found the following article helpful.

http://www.drdobbs.com/jvm/tail-call-optimization-and-java/2...

1 comments

Usually it is implemented by reshuffling stack frame + jumping to the call destination. See how it is done in .NET, for example.

Do not confuse tail recursion, which is the least interesting narrow case of a tail call, with tail calls in general.

Why can't you modify a JVM to do this? I don't get it.
Of course you can (but you have to add another instruction or an instruction prefix). But Oracle won't ever do it.