Dynamic linking of language-defined object models [JEP 276]
Java interoperability was enhanced with JEP 276. The necessary JDK changes were made to permit runtime linkers from multiple languages to coexist in a single JVM instance. This change applies to high-level operations, as you would expect. An example of a relevant high-level operation is the reading or writing of a property with elements such as accessors and mutators.
The high-level operations apply to objects of unknown types. They can be invoked with INVOKEDYNAMIC
instructions. Here is an example of calling an object's property when the object's type is unknown at compile time:
INVOKEDYNAMIC "dyn:getProp:age"
Proof of concept
Nashorn is a lightweight, high-performance, JavaScript runtime that permits embedding JavaScript in Java applications. This was created for Java 8 and replaced the previous JavaScript scripting engine that was based on Mozilla Rhino. Nashorn already has this functionality. It provides linkage between high...