JetBrains expands horizons: Kotlin now supports a new platform
The JetBrains team, creator of the popular Kotlin programming language, has announced an important update. As part of the development of the Kotlin Multiplatform (KMP) ecosystem, support for a new platform — WebAssembly (Wasm) — has been added. This solution opens up the possibility for developers to run Kotlin code directly in the browser with near-native performance.
What is WebAssembly and why is it important?
WebAssembly (Wasm) is a low-level binary instruction format that executes in modern browsers at high speed. Previously, a compiler to JavaScript (Kotlin/JS) was used for web development in Kotlin. Now, thanks to Wasm support, developers get an alternative, more performant way to create web applications.
WebAssembly support is not just a technical experiment. It is a strategic step that allows Kotlin to establish a stronger position in frontend development, an area previously dominated by JavaScript and TypeScript.
Key advantages of the new platform for Kotlin
- Performance: WebAssembly ensures code execution at near-native speed. This is especially noticeable in computationally intensive tasks — image processing, 3D graphics, simulations.
- Stack unification: Developers can now write business logic once in Kotlin and use it on the server side (JVM/Native), in the browser (Wasm), and on mobile devices.
- Security: Wasm runs in the browser's sandboxed environment, reducing risks associated with executing third-party code.
- Application size: Compiled Wasm modules have a compact size, which speeds up web page loading.
How does it work in practice?
To start working with Kotlin/Wasm, a developer needs to update the build tools (Gradle) to the latest version supporting Kotlin 1.9.20 and above. In build.gradle.kts, it is sufficient to specify the target platform wasmJs or wasmWasi (for server-side Wasm runtimes). After that, all Kotlin code, including the standard library and coroutines, will be compiled into Wasm bytecode.
Integration with existing frontends is also simplified: Kotlin/Wasm can interact with JavaScript code through special interop bridges. This allows gradual migration of application parts to Wasm without a complete rewrite.
What does this mean for developers and businesses?
- Cost reduction: Teams can reduce the number of programming languages used, focusing on Kotlin as a single language for backend, mobile applications, and now — for the web.
- Faster time to market: Code reuse across platforms accelerates development and testing.
- Expanded audience: Applications running in the browser via Wasm require no installation — users gain instant access to functionality.
The future of Kotlin and WebAssembly
WebAssembly support is just the beginning. JetBrains is actively working on improving debugging and profiling tools for Wasm targets. It is expected that upcoming releases will add full support for graphical interfaces via Compose Multiplatform, enabling the creation of web applications with a unified UI codebase for