Java 1.7 has included the new invokedynamic
opcode in its virtual machine. This new instruction
postpones until runtime the linking operation that is commonly resolved by the virtual machine at load time. Once
the link is established, the virtual machine performs its common optimizations, providing better
runtime performance than reflection. However, this feature has not been offered to the abstraction level
of the Java programming language. Since the functionality of the new opcode is not provided as a library,
the existing languages in the Java platform cannot use it as a library. For this reason, we have developed
the Jindy library that offers invokedynamic
to any high-level language
running on the Java platform.
Jindy postpones until runtime the class and instance methods invocations, the constructor calls, and the instance and static field accesses. It offers an alternative use to the reflection API, providing optimizations that avoid type conversions. It is also possible to provide custom bootstrap methods that resolve the method to invoke at runtime.
You can download the library, its source code, examples of how to use it, and runtime performance tests. You can also browse its documentation.