Does Kotlin native compile to bytecode or c?
# kotlin-native
s
Does Kotlin native compile to bytecode or c?
a
It compiles to native binaries depending on the CPU architecture. So if you're building for Arm64 it'll build ARM64 binaries or if you are building for X86 it will build X86 binaries. Byte code is used on the JVM and native does not use the JVM
e
https://github.com/JetBrains/kotlin/tree/master/kotlin-native#readme "_Kotlin/Native_ is an LLVM backend for the Kotlin compiler, runtime implementation, and native code generation facility using the LLVM toolchain."
Kotlin compiler translates IR to LLVM IR (or bitcode) then calls LLVM to produce native code, C is not involved
👍 3
l
Note that using the cli compiler, you can have it stop at the llvm bitcode. They seem to have removed this functionality from the Gradle plugin.