There's something called jextract that can replace...
# kotlin-native
l
There's something called jextract that can replace JNI and is basically cinterop for the modern JVMs. https://inside.java/2020/10/06/jextract/ Would be cool to have something similar in Kotlin that is backwards compatible to JDK 8 and Android (JDK 8 desugared to JDK6/7 then .dex).
👍 3
g
This requires support from JVM, it's a part of Panama, but there are other ways to generate JNI automatically
☝️ 1
I would like to see something similar, but it looks that it should be some tool on top of existing K/N cinterop
I also not exactly sure that generation of whole header file would be the best solution, usually you want limited API (imagine creating all those unused JNI methods from big API), approach with generate everything works pretty well with K/N, because it will use only on compile time, curious how to do the same for Kotlin/JVM, looks that it needs some compiler support
t
AFAIK there is unoffical cinterop support for JVM as well, that the Kotlin/Native compiler (which is JVM based) uses for some thing
g
yep, there is tool for C interop in K/N compiler There is a plenty tools for this in general on JVM