# KMM: What's Under the hood?

DevFeed: [KMM: What's Under the hood?](<https://devfeed.tech/articles/kmm-what-s-under-the-hood-24754.md>)

Original publisher: [Read original article](<https://medium.com/ymedialabs-innovation/kmm-whats-under-the-hood-1a26cb50ca67?source=rss----8b5620c36355---4>)

Author: Codeangi

Published: 2023-02-22T15:58:32Z

Content type: tutorial

Language: en

Sources: [ymedialabs-innovation - Medium](<https://devfeed.tech/sources/ymedialabs-innovation-medium.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>), [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [kotlin-native](<https://devfeed.tech/topics/kotlin-native.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [toolchain](<https://devfeed.tech/topics/toolchain.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [compilation](<https://devfeed.tech/tags/compilation.md>), [development](<https://devfeed.tech/tags/development.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [kmm](<https://devfeed.tech/tags/kmm.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-beginners](<https://devfeed.tech/tags/kotlin-beginners.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [mobile](<https://devfeed.tech/tags/mobile.md>), [mobile-development](<https://devfeed.tech/tags/mobile-development.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [toolchain](<https://devfeed.tech/tags/toolchain.md>)

## AI overview

This article explains Kotlin Multiplatform Mobile (KMM), focusing on how developers can share business logic, data, and connectivity implementation between Android and iOS. It also describes Kotlin/Native compilation through LLVM and Kotlin/JS compilation to JavaScript.

## Source excerpt

source There have been many tools for cross-platform development before but offered so little in terms of sharable code, there was always an overhead of writing and maintaining applications in a set-predetermined technology such as Phonegap, ReactNative, and Flutter. Kotlin provides a huge leeway in writing sharable code, especially when you are developing Mobile applications for Android and iOS with similar features. In the real world, it translates into fewer lines of code, fewer bugs, less time, and of course lesser cost of development. Whether you are starting a new project or adding a new feature to an existing one. This article is an effort to interpret KMM in layman's terms, knowing programming helps but is not mandatory.Topics Include: What is KMM, How it works, the Good, and the Bad.source Kotlin is a cutting-edge yet established programming language that offers a range of benefits for developers. One of the key use cases for Kotlin is its ability to share code between mobile platforms through Kotlin Multiplatform Mobile (KMM). By using KMM, developers can create cross-platform mobile apps and share crucial elements like business logic, data, and connectivity implementation between Android and iOS. Kotlin-Native In order to use Kotlin code in iOS, the Kotlin code is first compiled to LLVM bytecode using the Kotlin/Native compiler. LLVM (Low Level Virtual Machine) is a collection of modular and reusable compiler and toolchain technologies. The LLVM bytecode is then compiled using the iOS toolchain and linked with the iOS runtime libraries. The resulting binary is an iOS application bundle (an .app directory) that contains the Kotlin code and the Swift runtime. When the app is run, the Swift runtime loads the Kotlin code and uses it as if it were native Swift code. Kotlin/JS Kotlin/JS provides the ability to trans-compile Kotlin code, the Kotlin standard library, and any compatible dependencies to JavaScript. The current implementation of Kotlin/JS targets ES