Chander Shivdasani
Chander Shivdasani

Reputation: 10131

invokedynamic and its advantages to application developer

Recently, i was reading about Java 7 features and invokedynamic was one of the most anticipated one. Most of the blogs/articles provide the advantages from JVM implementation point of view, specially for dynamically typed languages. From an application developer point of view, how does it affect me?

Upvotes: 0

Views: 364

Answers (2)

Deepak Azad
Deepak Azad

Reputation: 7923

In Java you can use MethodHandle as a faster alternative to reflection. You can read a bit more about MethodHandles here.

Note that MethodHandle does not use invokedynamic, but MethodHandle feature was developed to provide support for invokedynamic. For a Java application developer MethodHandle is the only benefit that arises out of the work towards invokedynamic.

Upvotes: 2

jqno
jqno

Reputation: 15520

If you're writing an application in one of these dynamic languages, your app will (probably) run faster. Especially JRuby makes heavy use of it at the moment.

If you're writing in Java, it won't affect you, because Java (currently) doesn't use this instruction. I think there was some talk that one of the Java 8 language features might be using it, but I can't find a reference to that right now, and Java 8 is a long way away right now anyway.

Upvotes: 3

Related Questions