Waiting for interop for jvm. :grin:
# kotlin-native
b
Waiting for interop for jvm. 😁
3
m
Why not just use Kotlin/JVM? What is use-case?
g
To replace JNI. Actually not sure what it should be. Some compiler plugin for Kotlin/JVM or some Kotlin/Native and Kotlin/JVM interop
m
So it's really not "interop with jvm" but "interop jvm and c"?
cinterop -flavor=jvm
o
yes, Mike is right, we do have (although do not support) Kotlin/JVM -> C interop for internal purposes
b
After hours of searching, I still don’t know how to use “cinterop -flavor=jvm”… I just want to use Kotlin to replace Java on Jvm part and c/c++ on native part.
g
There are two similar, but not exactly the same cases: JVM interop with C JVM interop with Kotlin/Native They are interchangeable sometimes but would be nice to have both
Maybe, to have both as the same interop system Actually, for us most important to have C, but we plan to have also K/N components in the future, so seamless interop with K/N from JVM would be good too (even on level of common modules for example, without exposing of native types or APIs)
b
Agreed.
l
I think opening Kotlin/JVM <-> C & Kotlin/Native interop should be done as an experimental feature in future stages of Kotlin/Native so the Kotlin team can get feedback on the first interop design, and break things under experimental status if redesign/changes are needed
3
👏 2
g
Would happy to test such experimental feature with our project
2
o
Technically, nothing prevents you from using Kotlin/JVM -> C interop right away, it is not closed in any way.
l
I'm just not skilled enough to figure it out at the moment
n
Next best thing would be having serialisation/message passing in a static API style between Kotlin JVM, Kotlin Native, and Kotlin JS. 😀
o
Thanks Andrey, it makes perfect sense, although we have to keep balance with other directions of work, we fully understand importance of productization of Kotlin/JVM-> C interop
👍 2