Minikotlin: A Kotlin Compiler Running Entirely in Your Browser Tab
I built Minikotlin from scratch in C to compile Kotlin directly to WebAssembly GC bytecode without LLVM or Binaryen. This compiler runs entirely in your browser tab, supporting classes, coroutines, and null safety through a custom pipeline that emits raw bytecode. No JVM or external toolchain is needed, allowing you to write and execute Kotlin code instantly in the cloud.
The compiler is itself compiled to WASM, so .kt source goes in and a running .wasm module comes out, entirely in the tab.
- davidjfelix
Visibly claude produced website.
No link to code.
Is the expectation that people write kotlin in their browser? How do people work this into their development workflow? Is this just a neat demo?
- wavemode
> One pass, all the way down to bytecode
> hands off to two of its own IRs before writing WASM-GC by hand
So it's not "one pass" lol. Do you know what a pass is?
Not that it matters - this AI is claiming "one pass" as though that's a good thing, but it's usually not. One-pass compilers can't typecheck forward references.
- montroser
This is very cool! Slightly off-topic though, I miss technical people writing in their own voice about the awesome things they've built.
- gavinray
Seems to be missing the "why" over Kotlins native WASM support (which is very mature)
The official Kotlin playground uses WASM, for example (JVM drop down-> choose "WASM")
- modulovalue
I built something similar, but I managed to compile the Dart VM, its compiler and the static analyzer to wasm using emscripten:
- repo: https://github.com/modulovalue/dart-live
- demo: https://modulovalue.com/dart-live/
It's on my todo list to support compiling dart code through the wasm bundle to wasm directly. Right now it's running the dart arm simulator on the web because it supports hot reload.
I'm wondering if there are any cool use-cases that motivate having the compiler itself run in wasm. I did it mostly for fun and besides building tooling for compiler developers themselves or IDEs, I can't come up with much.
There was one guy that wanted a sandboxed environment for agents as he couldn't find anything else. A few other people used the dart live project to build playgrounds for their own packages.
Who's the target audience for minikotlin? I'm just curious.
In any case, cool project, thanks for sharing!