根据文档
Kotlin/Native is a technology for compiling Kotlin code to native binaries, which can run without a virtual machine. It is an LLVM based backend for the Kotlin compiler and native implementation of the Kotlin standard library.
所以 K/N 正在使用 LLVM 将 Kotlin 代码编译为 iOS 的 native 代码。 Swift compiler also uses LLVM to optimize and generate machine code .
最佳答案
主要区别在于为 iOS 编译的 Kotlin 代码带来了 Kotlin/Native 运行时,它建立了旨在安全的 Kotlin/Native 内存模型 concurrency和 immutability全局对象,并且还为 Kotlin 对象提供了自己的垃圾收集器。
否则,使用 Kotlin/Native 编译的代码确实有两种方式 interoperability with Swift ,和往常一样 the Kotlin binary你在 iOS 上使用的是一个 Objective-C 框架,你可以 import in one project with Swift .
关于ios - Kotlin Multi-platform Mobile 代码与 iOS 平台上编译的 Swift 代码不同吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63977041/