Could somebody ELI5 the difference between KMP and...
# getting-started
s
Could somebody ELI5 the difference between KMP and Native?
f
With Kotlin Native you can compile your Kotlin Code to "native" targets like Linux, iOs, MacOs. KMP helps you to share Kotlin Code between different Kotlin compile targets (JVM,JS,Native). It is using the Kotlin Multiplatform Gradle plugin. Kotlin Native can be used with KMP, but you don't have to. When you only want to share code between JVM and JS targets, you can also use KMP without Kotlin Native.
s
@Foso Thanks for the info. Why would I use one over the other?
m
KMP is an umbrella technology that lets you share common code and compile it for different platforms, depending on your needs. It can include Kotlin/Native, depending on your targets. If you don’t need your library or application to be developed for multi-platform, you don’t need KMP. If you need to compile only for Linux, for example, you just need Kotlin/Native. But if one day, you want to port that code to other platforms, you need to create a KMP project out of it.