cashapp/zipline

Build JVM variant on new JDK APIs for FFI

JakeWharton opened this issue · 2 comments

Project Panama's initial set of APIs will go stable in JDK 22 (March '24). We should build a variant of Zipline to support this, and use multi-release jars to enable that functionality on JDK 22+.

This will be faster than the JNI version. This will allow moving all the C++ code into Kotlin without introducing significant overhead (similar to the use of cinterop on Kotlin/Native).

Eventually, once JDK 22 is our minimum, the JNI code can move to be Android-only. And then at an even later time when our Android minSdk has the necessary Panama bits, we can eliminate JNI altogether. But that's all really far off...

Can you take a look at this repo?
https://github.com/Endoqa/kotlin-quickjs
QuickJS binding based on Project Panama, c-style api.

We would be binding against our own C++ code that talks to QuickJS, not directly to the QuickJS API.