Kotlin/Native for Native

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.
Why Kotlin/Native?
Kotlin/Native is primarily designed to allow compilation for platforms where virtual machines are not desirable or possible, for example, embedded devices or iOS. It solves the situations when a developer needs to produce a self-contained program that does not require an additional runtime or virtual machine.
Target Platforms
Kotlin/Native supports the following platforms:
- iOS (arm32, arm64, emulator x86_64)
- MacOS (x86_64)
- Android (arm32, arm64)
- Windows (mingw x86_64)
- Linux (x86_64, arm32, MIPS, MIPS little endian)
- WebAssembly (wasm32)
Interoperability
Kotlin/Native supports two-way interoperability with the Native world. On the one hand, the compiler creates:
- an executable for many platforms
- a static library or dynamic library with C headers for C/C++ projects
- an Apple framework for Swift and Objective-C projects
On the other hand, Kotlin/Native supports interoperability to use existing libraries directly from Kotlin/Native:
- static or dynamic C Libraries
- C, Swift, and Objective-C frameworks
It is easy to include a compiled Kotlin code into existing projects written in C, C++, Swift, Objective-C, and other languages. It is also easy to use existing native code, static or dynamic C libraries, Swift/Objective-C frameworks, graphical engines, and anything else directly from Kotlin/Native.
Kotlin/Native libraries help to share Kotlin code between projects. POSIX, gzip, OpenGL, Metal, Foundation, and many other popular libraries and Apple frameworks are pre-imported and included as Kotlin/Native libraries into the compiler package.
Sharing Code between Platforms
Multiplatform projects are supported between different Kotlin and Kotlin/Native targets. This is the way to share common Kotlin code between many platforms, including Android, iOS, server-side, JVM, client-side, JavaScript, CSS, and native.
Multiplatform libraries provide the necessary APIs for the common Kotlin code and help to develop shared parts of a project in Kotlin code once and share it with all of the target platforms.
How to Start
Tutorials and Documentation
New to Kotlin? Take a look at the Getting Started page.
Suggested documentation pages:
Recommended tutorials:
- A basic Kotlin/Native application
- Multiplatform Project: iOS and Android
- Types mapping between C and Kotlin/Native
- Kotlin/Native as a Dynamic Library
- Kotlin/Native as an Apple Framework
Example Projects
- Kotlin/Native sources and examples
- KotlinConf app
- KotlinConf Spinner app
- Kotlin/Native sources and examples (.tgz)
- Kotlin/Native sources and examples (.zip)
Even more examples are on GitHub.

