How is Kotlin preparing for the release of Project Panama?

It seems that the JEPs are getting closer to stable, with the Foreign Function & Memory API (FFM API) JEP moving to “preview” in JDK 19, and other JEPs on their 2nd and 3rd rounds of incubation.

Relevant links:
https://openjdk.java.net/projects/panama/
https://openjdk.java.net/projects/jdk/18/
https://openjdk.java.net/projects/jdk/19/

The JEPs I’m personally excited for are the FFM API and Vector API - it’d be great to have some higher level syntax to deal with FFM’s complexities, and @JvmInline value class-es would get a real powerup with access to SIMD primitives. I wonder if Kotlin Native already has or would receive access to these as well.

2 Likes

Bump. These changes are really important - will they at least be accessible within Kotlin?

I believe the Vector and FFM APIs are getting handled specially at the bytecode level, meaning that Kotlin will hypothetically be able to compile down to it. But I’m worried there could be interaction of features interfering with this (e.g. companion objects instead of JVM static fields, preventing JVM inlining of “layouts” in FFM API. Or @JvmInline classes not working correctly with vector types because it doesn’t think they’re “value types” i.e. primitives.) There’s a ton of complexity to consider here.

1 Like