Reputation: 4636
Is Kotlin/Native essentially Kotlin's JNI API? Will it be used only for C interoperability or does it have constructs to write pure native code with Kotlin? Do native operations bear the same overhead as JNI calls?
Upvotes: 3
Views: 693
Reputation: 3915
Kotlin native uses a LLVM (Low Level Virtual machine) to compile to native binaries.
It is independent of JVM. It doesn't need or use JVM.
You can't use Java System Libraries that haven't been implemented in native or Kotlin.
It also runs on IOS and pretty much everywhere a compiled C and C++ or Objective C binaries can run.
You can call C and Objective C libraries from Kotlin.
However Kotlin Native as of Novemeber 2017 can't build Shared libraries. Source: https://github.com/JetBrains/kotlin-native/blob/master/FAQ.md
Upvotes: 0
Reputation: 97148
Kotlin/Native is compiled to pure native code and runs without a JVM. There is no extra overhead for function calls in Kotlin/Native.
Upvotes: 5