Any plans for "cinterop" on the JVM?


Reading about all the new multi-platform project features has made me curious - are there any plans to eventually have the same cinterop tooling from Kotlin Native on the JVM Kotlin?

This would be really convenient not only for writing multi-platform libraries (same C interface on both platforms), but also because cinterop on Kotlin Native is actually more convenient than any solution that exists on the JVM today (Swig, JNA, JNR, etc.).

Interoperability between kotlin-native and kotlin-jvm

I wouldn’t be surprised to see an ‘easy’ way emerge for interoperation between Kotlin JVM and Kotlin Native - in fact I’d be more surprised if it didn’t.

However, as far as the more general problem of easier native interop with Kotlin JVM is concerned, I think it would make sense now to wait and see if Project Panama is implemented for Java itself and, if it is, piggy-back onto that.

According to this article this might come as early as March 2018 (in Java 18.3) or not too long afterwards now that 6 monthly releases are planned for new features.