https://kotlinlang.org logo
Title
a

altavir

02/26/2019, 2:06 PM
Well, JNI is not about build. You have to make a wrapper, then compile both parts. It is not pleasant. One can use JNA or JNR instead
o

otakusenpai

02/26/2019, 2:06 PM
I haven't even heard of JNA or JNR. 😞
a

altavir

02/26/2019, 2:08 PM
JNA is a reflection - based native interface generator. It is generally slower, but much easier. JNR is a code-generation wrapper. It looks very promising and taken as a base for project Panama and next generation native interface for jvm, but last time i checked the documentation was bad.
o

otakusenpai

02/26/2019, 2:10 PM
Hmm... I don't know, isn't JNI the part shipped with Java? The two others look like separate libraries on themselves
a

altavir

02/26/2019, 2:12 PM
yes. JNI is the intrinsic part of JVM. All others are libraries. Kotlin probably will have some kind of direct bridge between kotlin-jvm and kotlin-native in future which will save us completely from JNI boilerplate, but no yet
o

otakusenpai

02/26/2019, 2:14 PM
Yeah
JNA looks like the better of the 3 but its dual licensed(under LGPL 2 and Apache). Ahh we can choose our own license.
Brb, i have some study to do now, I'll be looking at this thread later on. If you need any help I'll be glad to do so 🙂