• Post Reply Bookmark Topic Watch Topic
  • New Topic

can java 1.8 compete with other functional programing languages.

 
Kerim Kara
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Venkat

java 1.8 functional programmin capabilities are limited to other languages like Scala or Lisp.
do you think java 1.8 is efficient as others ?
 
Venkat Subramaniam
Author
Ranch Hand
Posts: 109
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kerim,

I was very lukewarm about lambdas in Java 8, but all the changed when I looked under the hood.

Java 8 lambdas make really great use of invokedynamic. In Java 7 invokedynamic was originally introduced to help dynamically typed languages.
Soon the designers of Java realized that compiling lambdas to inner classes is not going to help. It was quite a surprise that they finally decided to
reimplement invokedynamic in a way that the biggest user of this feature now is Java.

So, one efficiency comes from invokedynamic. The other efficiency comes from the lazy evaluation capability built into Streams.

Take a look under the hood, run some prototypes, and see how it measures up.

Thanks,

Venkat
 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While Streams are a very powerful feature, there are not enough resources that teach people how to implement their own Spliterators that can be parallelized.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!