Scala has already been doing it for quite some time now, but just within a
single method.

It will happen by default where possible.  If you want to be certain then
use the @tailrec annotation on your method, which will force the compiler
to emit an exception if it can't be done.

For anything "bigger", such as tail recursing across two or more methods,
you'll need something like the trampoline functionality that scalaz
provides.
On Jul 20, 2012 9:31 PM, "clay" <[email protected]> wrote:

> Is tail call recursion support coming to JVM?
>
> Many algorithms are most elegantly expressed in a recursive nature.
> Textbooks and academics typically use the most appropriate and elegant
> notation available, but a JVM programmer is expected to manually avoid
> recursive code due to the lack of internal optimization.
>
> I've heard Scala is working on this optimization at the language compiler
> level, but also that it would be more efficiently implemented at the VM
> level. Secondly, it would be nice if the flagship JVM language, Java,
> supported this.
>
> If Jigsaw is being postponed from JDK 8, this would be another big
> potential feature to have.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Java Posse" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/javaposse/-/VknSiMzz9kUJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/javaposse?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Java 
Posse" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to