Skip to content
Tech News
← Back to articles

Saying goodbye to asm.js

read original get WebAssembly Developer Bundle → more articles
Why This Matters

Mozilla is disabling and planning to remove asm.js support in Firefox 148, as WebAssembly has become the preferred technology for high-performance web code. This shift signifies a maturation in web performance standards, encouraging developers to adopt WebAssembly for faster, more efficient applications. The transition highlights the industry's move towards more modern, secure, and optimized web technologies, benefiting both developers and users.

Key Takeaways

Axe-time, sword-time, shields are sundered,

Wind-time, wolf-time, ere the world falls.

– Völuspá, Poetic Edda

As of Firefox 148, SpiderMonkey’s asm.js optimizations are disabled by default, and we plan to remove the code entirely in a future release.

If you maintain a site that uses asm.js, nothing will break. asm.js is just a subset of plain JavaScript, so the code keeps running through our regular JIT just like any other script. That said, recompiling to WebAssembly will get you faster execution and smaller binaries.

History

asm.js was Mozilla’s response to the question posed by NaCl and PNaCl: how can the web run code at native speeds?

The idea was clever: pick a strict, statically-typed subset of JavaScript that an engine could recognize on the fly and compile down to native code. We could get performance similar to NaCl/PNaCl and still have code live inside web content and use web API’s (no separate sandbox, IPC, or alternative API’s).

asm.js shipped in Firefox 22 back in 2013 and was a success. It let projects like Unity and Unreal ship C/C++ codebases to the web for the first time, using just standard web technologies. The Epic Citadel demo was ported to the web in just four days. It was a landmark achievement, and a fond memory for the original asm.js team.

asm.js proved that we could run code at near-native speed on the web using just web technologies. This opened the door to WebAssembly, which shipped several years later in Firefox 52. Without asm.js, we likely wouldn’t have WebAssembly.

... continue reading