The Kotlin/JVM and Kotlin/Native compilers share the front-end (the part that performs code parsing, name resolution, type inference etc.), but the compiler back-ends that translate the internal program representation to the target code (the JVM bytecode and LLVM bitcode, respectively) are different.
The Kotlin language accepted by the two compilers is the same, but some of the features and checks are platform-specific. Also, the standard libraries for Kotlin/JVM and Kotlin/Native are sufficiently different, see the APIs available on each platform here: Kotlin Standard Library.
Another big difference is the memory model: Kotlin/JVM uses the Java memory model, while Kotlin/Native offers its own concurrency and memory model.
此外,可以在Kotlin/JVM和Kotlin/Native项目中使用的依赖项也不同.除了使用同一Kotlin目标建造的项目外:
Kotlin/JVM can also use any libraries built for the JVM (written in Java, Scala etc.)
Kotlin/Native还可以使用C interop tools与用C编写的本机库(或至少具有C头)进行互操作
Kotlin/JVM和Kotlin/Native都可以使用Kotlin多平台库.考虑到依赖项是一个多平台库,可以在Kotlin/JVM和Kotlin/Native之间完全重用使用它的代码.