Add Java 8+ API desugaring support

Hi,

Technically it is possible to add desugaring support, it would basically replace the Retrolambda component of the compilation process. However, this in itself will not solve the missing classes issue. To get these classes in class library, we would need to update the MOE runtime to a newer version of Android (right now it matches Android 6). This is a substantial amount of work:

  • updating the port of ART to iOS to use e.g. Android 11 ART
  • the new version of ART will require us to update the rest of the runtime as well, including moving to the OpenJDK based class library. Most of the tasks here are relatively straightforward porting work, but the biggest issue I can recall was with ICU. Unfortunately iOS does not export the full ICU API, but the class library is using ICU extensively. In the current version we have a partial ICU “emulation” that uses the iOS APIs and implements just enough so the old Apache Harmony based class library can work. This needs to be updated for the OpenJDK version, or we have to include the ICU database in each app that will increase the application size substantially.

Another option is looking at adding GraalVM (SubstrateVM) as an alternative Java runtime to MOE. Since Nat/J is using the standard JNI API, this should be feasible without major issues.

Best Regards,
Gergely

3 Likes