Kotlin/Wasm has the power to compile your Kotlin code into WebAssembly (Wasm) format.
On this page
Introduction
Kotlin/Wasm has the power to compile your Kotlin code into Web - WebAssembly format. With Kotlin/Wasm, you can create applications that run on different environments and devices, which support Wasm and meet Kotlin’s requirements.
Wasm is a binary instruction format for a stack-based virtual machine. This format is platform-independent because it runs on its own virtual machine. Wasm provides Kotlin and other languages with a compilation target.
You can use Kotlin/Wasm in different target environments, such as browsers, for developing web applications built with Compose - Wasm, or outside the browser in standalone Wasm virtual machines.
In the outside-of-browser case, WebAssembly System Interface (WASI) provides access to platform APIs, which you can also utilize.
WASI
Kotlin/Wasm uses the WebAssembly System Interface (WASI) for server-side applications. Applications built with Kotlin/Wasm and WASI use a Wasm-WASI target, allowing you to call the WASI API and run applications outside the browser environment.
Kotlin/Wasm leverages WASI to abstract away platform-specific details, allowing the same Kotlin code to run across diverse platforms. This expands the reach of Kotlin/Wasm beyond web applications without requiring custom handling for each runtime.
WASI provides a secure standard interface for running Kotlin applications compiled to WebAssembly across different environments.
To see Kotlin/Wasm and WASI in action, check the Get started with Kotlin/Wasm and WASI tutorial.