WAMI: Compilation to WebAssembly through MLIR without Losing Abstraction
Byeongjee Kang, Harsh Desai, Limin Jia, Brandon Lucia · 2026
WebAssembly (Wasm) is a portable bytecode format that serves as a compilation target for high-level languages, enabling their secure and efficient execution across diverse platforms, including web browsers and embedded systems. To improve support for high-level languages without incurring significant code size or performance overheads, Wasm continuously evolves by integrating high-level features such as Garbage Collection and Stack Switching. However, existing compilation approaches either lack reusable design—requiring redundant implementation efforts for each language—or lose abstraction by lowering high-level constructs into low-level shared representations like LLVM IR, which hinder the adoption of high-level features. The MLIR compiler infrastructure provides multiple levels of abstraction that could address this limitation, yet its current Wasm pipeline relies on the LLVM backend, inheriting LLVM’s limitations.