Is tail call elimination the same as tail call optimization? I know that schemes use this to keep the stack from blowing up during recursive function calls, and that currently the JVM, and by extension Clojure is not able to handle this.
I also remember reading somewhere that this wasn't possible to add/not on the road map for the JVM. Does project Loom change this?
The way I read it, tail call elimination is the guaranteed application of tail call optimisation with a well defined meaning of what a tail call is. Eg scheme requires TCE.
Tail call optimisation is a transformation a compiler may choose to do to make code that looks like “return foo(...)” run faster. A compiler may choose to not do it because it might not be implemented or faster or it could make debugging harder. There is no guarantee it will happen.
TCO makes some code faster. TCE allows one to write different looking programs knowing they won’t blow up the stack.
This all being said I think most people mean what I have referred to as TCE when they say TCO.
> Is tail call elimination the same as tail call optimization? I know that schemes use this to keep the stack from blowing up during recursive function calls, and that currently the JVM, and by extension Clojure is not able to handle this.
Yes, the elimination of the tail call is the optimization.
FWIW, Clojure handles this through syntax, so recursive algorithms are generally implemented with loop/recur forms that don't blow up the stack (instead of having a function literally call itself): https://clojuredocs.org/clojure.core/loop
I also remember reading somewhere that this wasn't possible to add/not on the road map for the JVM. Does project Loom change this?