0

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?

2 Answers 2

3

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.

2

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.

3
  • This reply is now completely obselete & should be deleted.
    – kittylyst
    Mar 11, 2015 at 16:05
  • can you please elaborate ? Mar 12, 2015 at 16:15
  • Java 8 uses invokedynamic under the hood for quite a lot of its functionality - including lambdas & default methods
    – kittylyst
    Mar 14, 2015 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.