← Back to Blogs
HN Story

The Twilight of OdinMonkey: Saying Goodbye to asm.js

May 22, 2026

The Twilight of OdinMonkey: Saying Goodbye to asm.js

Mozilla has officially announced the sunsetting of asm.js optimizations within the SpiderMonkey engine, starting with Firefox 148. While the specialized optimizations—handled by the compiler known as OdinMonkey—are being disabled by default and will eventually be removed entirely, the language subset remains functional. Because asm.js is a strict subset of JavaScript, any existing sites using it will continue to run via the regular JIT (Just-In-Time) compiler, though they will no longer benefit from the hyper-specialized performance boosts that once made it revolutionary.

This move signals the final transition from a transitional technology to a permanent standard. For developers still maintaining asm.js content, the recommendation is clear: recompile to WebAssembly (Wasm). Modern Wasm pipelines are significantly more advanced, offering faster execution and smaller binary sizes than asm.js ever could.

A Bridge to the Modern Web

To understand why this removal matters, one must look back to 2013. At the time, the web faced a fundamental question: how could browser-based applications run code at native speeds? Google's Native Client (NaCl) and PNaCl offered a solution, but they required separate sandboxes and complex IPC mechanisms.

Mozilla's response was asm.js. By defining a statically-typed subset of JavaScript that engines could recognize on the fly, Mozilla allowed C/C++ codebases to be ported to the web without sacrificing the web's inherent compatibility. The impact was immediate. Projects like Unity and Unreal Engine began shipping to the browser, and the famous Epic Citadel demo was ported in just four days, proving that high-performance gaming and complex software were viable in a browser environment.

From OdinMonkey to BaldrMonkey

In the internal nomenclature of the SpiderMonkey team, the asm.js compiler was named OdinMonkey. Its retirement is being framed as a "Ragnarök"—the Norse apocalypse—leading to the way for a new world.

Born from the lessons of OdinMonkey is BaldrMonkey, the WebAssembly optimizing compiler, and RabaldrMonkey, the baseline compiler. The evolution from asm.js to Wasm was not accidental; asm.js provided the proof-of-concept that the web could handle near-native performance, which directly informed the design and implementation of WebAssembly.

The Trade-offs: Why Some Still Miss asm.js

While the industry has overwhelmingly migrated to WebAssembly, the community discussion surrounding this announcement reveals a few lingering preferences for the asm.js approach.

Direct API Access

Some developers argue that asm.js had a distinct advantage in its integration with the JavaScript ecosystem. Because it was "just JavaScript," it could call Web APIs directly without the shims or glue code often required by Wasm.

"You can't call most web apis from wasm... The isolation is a good thing, but also a bad thing."

Zero-Copy Buffers

Another point of contention is the movement of data. Some users noted that zero-copy buffers between JavaScript and Wasm can be difficult to implement, whereas asm.js operated within the same memory space as the rest of the script.

Runtime Generation

For those who use JavaScript to generate code at runtime to optimize algorithms, the loss of a specialized asm.js path is a blow. Generating Wasm binaries at runtime is significantly more complex than generating a string of specialized JavaScript.

The Verdict

Despite these niche advantages, the maintenance cost of keeping the asm.js path alongside Wasm is too high for Mozilla. Every specialized path in a VM increases the attack surface for security vulnerabilities and requires ongoing maintenance time.

As one community member noted, the transition is logical: asm.js was never intended to be a permanent legacy mechanism, but rather a compilation target for native code. Its role as a bridge was successful, and the bridge has now been crossed. The web has evolved from the experimental days of OdinMonkey to the robust, standardized world of WebAssembly, and as the original team puts it, "Skål!"

References

HN Stories