aspose file tools*
The moose likes Features new in Java 8 and the fly likes Will Java 8 compiler ready to optimise the tail recursion calls Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Features new in Java 8
Bookmark "Will Java 8 compiler ready to optimise the tail recursion calls" Watch "Will Java 8 compiler ready to optimise the tail recursion calls" New topic
Author

Will Java 8 compiler ready to optimise the tail recursion calls

Dipta P Banerjee
Greenhorn

Joined: Dec 20, 2010
Posts: 11

Some of the compilers were able to optimise the tail recursion calls, for example Scala does. But till Java 7 tail recursion calls are not optimised by the Java compiler. Will Java 8 compiler is going to generate optimised byte codes for tail recursion?

I did some R&D on Scala and Java 7 compiler and posted my thoughts at Tech.pro
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
No, Java 8 does not do this. Java remains fundamentally an OO language, with only some functional features added to it.


Ping & DNS - my free Android networking tools app
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3014
    
  10
I don't think there's anything in Java's fundamentally OO nature that would prevent it from having tail call optimization. It's just not a particularly high priority, and they've had a lot of other features they wanted to get in.
Richard Reese
author
Ranch Hand

Joined: Jul 13, 2011
Posts: 84
    
    5

Dipta,

I don’t address this topic in the book but the following article may help: http://www.drdobbs.com/jvm/tail-call-optimization-and-java/240167044



Richard Reese
Java 8 New Features: A Practical Heads-Up Guide
Dipta P Banerjee
Greenhorn

Joined: Dec 20, 2010
Posts: 11

Richard Reese wrote:Dipta,

I don’t address this topic in the book but the following article may help: http://www.drdobbs.com/jvm/tail-call-optimization-and-java/240167044



Thanks Richard, specially pointing to the article.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Will Java 8 compiler ready to optimise the tail recursion calls