15.7.10

Make My Java Program Supports Dynamic Language (3)

What’s New in JDK 7?

  • Faster:

With the addition of support for JSR 292 in JDK 7, dynamically typed languages should run faster in the JVM than they do today.

  • Compilable –> bytecode

A key part of this support is the addition of a new Java bytecode, invokedynamic, for method invocation, and an accompanying linkage mechanism that involves a new construct called a method handle. These features enable implementers of compilers for dynamically typed languages, that is, the people who develop compilers for languages such as JRuby and Jython, to generate bytecode that runs extremely fast in the JVM.

  • interface injection

The JSR 292 Expert Group is also investigating support for interface injection, the ability to modify classes at runtime so that they can implement new interfaces -- this is a feature that is common in dynamically typed languages.

No comments: