What is Kotlin Native(MultyPlatform) How it works?


In this blog, I will tell you what is Kotlin native and how it works.
For a long time, I am searching a language which can target multiple platforms as well as can use in frontend as well as backend APIs. Kotlin is doing the same its targeting java and javascript.

what is Kotlin Native?
we all know that java and Kotlin in 100% interoperable it means you can convert java to Kotlin or Kotlin to java and we all think that it uses JVM to compile its source code and that how it works when we use it with JVM but it does not always work and compile like that.



kotlin can also compile using Konan which is kotlin native compiler which handles frontend of the process it compiles kotlin code into IR(Intermediate Representation)
and by the help of LLVM compiler, IR codes generate Native Binary. kotlin native can run on any platform that supports LLVM.  If you don't know about LLVM it's a library that is developed by the same developer team that makes Swift so Kotlin is like Swift in IOS.
To target Multiplatform kotlin Native uses shared business logic module so it's not magic which we can run in any platform you have to make platform-specific UI  then you can share business logic between different type of targeted platform so its make code fully native that is highlighting feature.


kotlin native still in development beta phase there is a lot which is coming on in near future hops you like this blog. 

Post a Comment

0 Comments