Kotlin/WASM: Compiling to WebAssembly for the Browser
Target Kotlin/WASM, integrate with JavaScript, and run in a browser environment.
What Is Kotlin/WASM?
Kotlin/WASM is a Kotlin compilation target that produces WebAssembly (.wasm) modules for execution in browsers and server-side WASM runtimes. It is separate from Kotlin/JS and provides better performance and a smaller binary size for compute-intensive code.
Current Status (Kotlin 2.0)
As of Kotlin 2.0, Kotlin/WASM targets the WasmGC proposal — a W3C standard that brings garbage-collected objects natively to WebAssembly. WasmGC is supported in Chrome 119+, Firefox 120+, and Safari 18+. Kotlin/WASM is Stable as of Kotlin 2.1.
All lessons in this course
- Kotlin/Native Overview: Targets, Toolchain & Compilation
- Memory Management in Kotlin/Native: The New MM
- C Interop with cinterop and .def Files
- Kotlin/WASM: Compiling to WebAssembly for the Browser