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.

6 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

any news on this? specifically regarding Android

1 Like

Hello,

Swift is moving toward adopting this they presented it during Swift Server Conf here https://youtu.be/wn6C_XEv1Mo?feature=shared&t=1461 and this is the repo GitHub - swiftlang/swift-java I do think that these tools will help the interop with Swift and provide better performance and developer experience.

1 Like