Introduction

Kotlin Multi Platform is all about shared code. Let’s compare this to the multi platform concept of the JVM. Java compiles down to byte code which in turn is executed on the JVM. The JVM is available for multiple platforms and executes the byte code.

JVM Multi Platform

On the other hand Kotlin Multi Platform compiles Kotlin directly to the target platform´s execution format.

Kotlin Multi Platform

Supported Target Platforms

Currently Kotlin Multi Platform supports the following targets:

Eco System

Kotlin has quite a sophisticated standard library. Large parts of it are supported on all target systems, but the strength of Kotlin´s approach is that it makes it easy to use the eco system of target system. On the JVM Kotlin can make use of all Java APIs. When compiling to Java Script then Node and NPM can be used to use any JS library out there.

Use of the target system

Server - Client vs. Client - Client Multi Platform

Kotlin can be used to implement Server - Client as well as Client - Client multi platform solutions.

When used for Server - Client Kotlin for example compiles the same algorithm or communication protocol to Java byte code as well as to JavaScript.

Server Client

The same way for Client - Client Kotlin can compile some “Business Logic” to Android, iOS and Java Script.

Client Client