New JDK 7 Feature: Support for Dynamically Typed Languages in the Java Virtual Machine
By edort on Jul 07, 2009
Over the years, the Java virtual machine (JVM) has been host to a growing number of languages. Increasingly, JVM implementations of dynamic languages are becoming available, such as JRuby, an implementation of the Ruby programming language, Jython, an implementation of the Python programming language, and the Groovy scripting language.
However, developers of these dynamic languages have faced a troublesome obstacle. When developers write engines for dynamically typed languages that run in the JVM, they have to satisfy the requirements of the Java bytecode that the JVM executes. Until now, that bytecode has been designed exclusively for statically typed languages. This design has been especially painful for developers when generating bytecodes for method invocations.
But help is on the way. JSR 292: Supporting Dynamically Typed Languages on the Java Platform, which is being implemented in JDK 7, introduces a new Java bytecode instruction for the JVM,
invokedynamic, and a new method linkage mechanism based on method handles.
Learn more about this new JDK 7 feature in the article Support for Dynamically Typed Languages in the Java Virtual Machine.