SkillRary

Please login to post comment

What is Kotlin/Native

  • Amruta Bhaskar
  • Oct 1, 2020
  • 0 comment(s)
  • 2161 Views

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, simulator x86_64)
  • macOS (x86_64)
  • watchOS (arm32, arm64, x86)
  • tvOS (arm64, x86_64)
  • Android (arm32, arm64, x86, x86_64)
  • Windows (mingw x86_64, x86)
  • Linux (x86_64, arm32, arm64, MIPS, MIPS little endian)
  • WebAssembly (wasm32)

If you are starting with Kotlin, you will find it very easy in the beginning and then when you upgrade to Kotlin Native, you will not find it very easy because there are not many dedicated IDEs out there that help in the development process.

The only IDE in the JetBrains family that supports it at this time is CLion, which is problematic for projects looking to be multiplatform with JVM, JS or iOS. And the biggest problem, in my opinion, is that CLion doesn’t support Gradle. This is a major reason why I will not be using CLion for the implementation.

The Kotlin Native compiler transforms the Kotlin code into LLVM intermediate representation (IR).

The LLVM compilers understand IR, then create binaries for the desired platforms.

Advantages

One of the primary advantages of Kotlin/Native is the GUI, sensors, notifications and everything that is unique and specified to each device that will be developed in the native language and runtimes without restriction.

Barriers are reduced when it is compared to other programming languages.

It helps in cross-platform application development.

Focuses on sharing as much code required for execution when compared to other cross-platform tools.

Please login to post comment

( 0 ) comment(s)