Re:The Upcoming Jack and Jill Compilers in Android
by pjmlp on Monday December 01, 2014 @12:42PM
(#8682414)
> Dalvik VM and ART handle Dalvik bytecode generated from Java the language....
Version 6, with partial support for Java 7 added in Android 4.4 tooling.
> Indeed, it's possible to use lambdas on Android today with Kotlin, Scala, and Retrolambda, for example. It's possible to further optimize handling of lambdas on future releases.
All workarounds for Google's lack of support in the official tooling.
Dalvik VM and ART handle Dalvik bytecode generated from Java the language, which is separate from the Java virtual machine. Using the same mechanisms as the Java Virtual Machine (and its reference HotSpot implementation) is not technically required to handle features in the Java language, as GCJ, GWT, j2obj, Dalvik, and now ART have shown.
> Given how Android updates work...
Because it is trivial to transform invokedynamic into Dalvik bytecode, my suggested design will work on all existing devices. Indeed, it's possible to use lambdas on Android today (without invokedynamic) with Kotlin, Scala, and Retrolambda, for example. It's possible to further optimize handling of lambdas on future releases.
Invokedynamic is not a significant barrier to implementing lambda support on Android. Handling the class library update is, and Jayce and related tooling seems to provide a way to solve that problem. It might even help provide full support for Java 7 to older devices by putting AutoClosable implementations of classes into the APK when necessary.