News for hackers. Stuff that matters.
Re:Tail Call Recursion in Java with ASM (2023) by thfuran on Sunday March 30, 2025 @05:11PM (#43527697)
Is there? As you say, there's already inlining, and I don't see how tco presents a harder case for that.
Re:Tail Call Recursion in Java with ASM (2023) by smarks on Monday March 31, 2025 @06:17PM (#43540573)
There are similarities in the problems, but there are also fundamental differences. With inlining, the JVM can always decide to deoptimize and back out the inlining without affecting the correctness of the result. But it can't do that with tail calls without exposting the program to a risk of StackOverflowError.

We've been using TCO here ("tail call optimization") but I recall Guy Steele advocating for calling this feature TCE ("elimination") because programs can rely on TCE for correctness.