What would be the difference between kotlin multip...
# multiplatform
j
What would be the difference between kotlin multiplatform and compose multiplatform? I know this is perhaps a beginner's question, but I had difficulties understanding if there is indeed a difference or if the names are synonyms
m
Compose is mostly used to talk about the UI framework, initially made for Android and now also usable multiplatform thanks to Jetbrains. Kotlin multplatform is about the programming language. Compose UI uses the Kotlin language
Note: Compose in itself is not limited to UI but it's a compiler plugin to work with trees of nodes. Most of the times people use Compose and Compose UI interchangeably but this is somewhat misleading
p
In KMP, you share common Kotlin logic/code between the platforms. You still have UI and other software entities in the platform language, and use Kotlin code in a form of compiled library that each platform support. Compose-mp, kinda similar, you can do the same as above but it comes with a set of predefined platform bindings already compiled for you, and the most important, compose, which will do the ui for all the platforms
s
All the answers above ^^^ You can also see it a 'Compose Multiplatform' can be part of your overall KMP solution, but it is not needed if you decide you want to have two different code-bases (native) for Android and iOS (and other targets). KMP is for sharing code between the various targets (Android, iOS, JS, etc). As much or as little code as you want. Compose-MP is for sharing code, related to building UIs based on JetPack Compose, between the various targets. It can be part of your KMP project.
j
Thank you all! The answers were very helpful!