Why Kotlin Multiplatform?
Optional means the tech is designed to be used along with the native tech. Most cross-platform frameworks allow you to integrate them into existing apps, but are generally not designed to make that easy. The optional sharing nature means it is easy to evaluate KMP in your existing apps. The optional sharing nature makes KMP low-risk.
Kotlin was designed to interop with the JVM directly, and Kotlin Native has been designed to use LLVM to produce actual “native” code. For iOS, the Kotlin compiler outputs an Xcode Framework that Objective-C and Swift can communicate with directly.
Most new languages and platforms are developed as open source. Not only does open source significantly reduce the risk of debugging issues, but it also allows the community to participate in the platform development. To help ensure good public direction and guidance, Jetbrains and Google, along with other industry representatives, created the Kotlin Foundation to help steer future Kotlin direction.
This is important. For libraries, support, training, hiring, etc. The ecosystem you pick needs to be popular. Having a very small ecosystem introduces it’s own form of risk. Kotlin Multiplatform is currently small, but growing very rapidly. It is very unlikely to lose momentum now. There will be an early adopter impact, but there’s also an early adopter opportunity.
Kotlin is a changing platform, attempting to incorporate lessons from other languages and ecosystems. This will mean better productivity and safety, and a longer “shelf life” for the ecosystem as a whole. It is a future-proofed ecosystem.
One of my own favorite quotes is: “The history of shared UI has a lot of pain and failure. The history of shared logic is the history of computers.” Speaking of native mobile specifically, Android and iOS are very similar under the hood. If the tooling was great, and the integration was seamless, it would be crazy not to create a shared codebase for at least some of the logic and architecture of applications.
What’s in Touchlab’s Essential Guide to Kotlin Multiplatform?
Smart Time to Share Common Code
Why this is a unique moment in mobile development history
Framework to Evaluate Multiplatform Solutions
A framework for evaluating popular multiplatform mobile solutions
The KMP Pitch
Why Kotlin Multiplatform (KMP) is the most flexible and least risky solution for your mobile development team
Excerpt from our Essential Guide to Kotlin Multiplatform
Kotlin enables you to write once, and test once. No siloed development teams. The same code can be used across Android, iOS and Web apps with no changes, eliminating the need for a translation layer. In essence, you’re reducing the amount of business logic coded by frontend developers by consolidating it efficiently with native code, but not oversimplifying abstractions. What’s not to love about that? No wonder there’s a groundswell of enthusiastic support in developer communities around the world. There are 1.5 million developers currently using Kotlin, with 96,000 GitHub repositories containing 100 million lines of code. And the numbers keep growing. It’s one of the top two languages that developers are hungry to learn.
Kotlin was developed as a completely new language eight years ago, built from the ground up as a pragmatic approach to coding – a way to develop cleanly, clearly, and quickly.
Simply put, Kotlin is more readable, reusable, interoperable, and safer, offering a first-rate developer experience.
Developers love our community contributions
— “…was able to build and run both platforms with no issues and fast build times.”
— “Wow great work! I was able to open the iOS project as well after I ran the build command. I still have to wrap my head around the whole idea but very NICE!“