Minikotlin compiles Kotlin directly to WebAssembly GC
Minikotlin is a from-scratch Kotlin compiler written in C that compiles code directly into WebAssembly GC bytecode within a browser tab. Operating entirely client-side, it features an offline multi-file editor and supports classes, generics, and continuation-passing style coroutines without external dependencies.
A brilliant proof of concept showcasing how lightweight compiler toolchains can become when targeting WebAssembly GC directly. By avoiding heavy intermediate backends like LLVM or JVM, it demonstrates the feasibility of instant-startup, serverless compiler sandboxes.
* Compiling the compiler to WebAssembly GC allows the entire compilation and execution pipeline to happen in a single client-side tab under 50ms.
* Custom lowerings map high-level Kotlin paradigms (like smart-casts and virtual calls) directly onto native WebAssembly features like `ref.test` and `call_ref`.
* Coroutines compiled via continuation-passing style (CPS) closures avoid the overhead of heavy runtimes or experimental APIs like JSPI.
* While not a production replacement for the official JetBrains toolchain, it serves as a masterclass in modern WebAssembly compilation and lightweight compiler engineering.
DISCOVERED
2h ago
2026-07-17
PUBLISHED
5h ago
2026-07-17
RELEVANCE
AUTHOR
frizlab