Kotlin/Native, built on the LLVM compiler infrastructure, compiles Kotlin source directly to native machine code for a target platform — no JVM, no bytecode, no separate runtime installation needed on the target machine. JetBrains' own documentation frames its purpose more broadly — "platforms on which virtual machines are not desirable or possible," citing embedded devices and iOS as examples, alongside Linux, Windows, and the rest of the Apple platform family. iOS is its most prominent real-world use today, since Kotlin Multiplatform's shared business logic can run there only through Kotlin/Native (no JVM exists on iOS at all); the compiled Kotlin code becomes a native framework an iOS app can link against directly. Kotlin/Native manages its own memory with its own garbage collector, distinct from the JVM's — recent Kotlin releases (including 2.4) have focused specifically on improving this GC's behavior for smoother iOS integration.
Compiling a standalone native binary
The resulting binary runs directly on the target OS, with no JVM installation required at all — genuinely different from a regular Kotlin/JVM program, which always needs a JVM present to execute.
$ kotlinc-native hello.kt -o hello
$ ./hello.kexe // runs as a native executable — no JVM neededWhy Kotlin/Native exists: iOS support
A KMP project's commonMain business logic, compiled through Kotlin/Native, becomes a framework an iOS app written in Swift can import and call directly — this is Kotlin/Native's most prominent real-world payoff for most teams, since Kotlin/JVM alone could never run on iOS, even though Kotlin/Native itself was designed for VM-less targets generally, not iOS specifically.
kotlin {
iosArm64()
iosSimulatorArm64()
sourceSets {
commonMain.dependencies {
// shared business logic, compiled to a native framework for iOS
}
}
}Interop with C and Objective-C libraries
Kotlin/Native can call existing C libraries directly, generating Kotlin bindings from a library's headers — genuinely useful for reusing existing native code rather than reimplementing it in Kotlin from scratch.
// a .def file describes the C library to bind against;
// the Kotlin/Native compiler generates Kotlin declarations from its headers automatically,
// letting Kotlin code call into existing C or Objective-C libraries directly