Saying Goodbye to Asm.js

TL;DR

Mozilla’s Firefox 148 has disabled asm.js optimizations by default and plans to remove the code entirely. WebAssembly has largely replaced asm.js for web performance. The transition marks the end of an era for web-based native code execution.

Mozilla’s Firefox 148 has disabled SpiderMonkey’s asm.js optimizations by default, with plans to remove the code entirely in a future release. This marks the end of asm.js support, which has been integral to web performance since 2013.

As of Firefox 148, the asm.js optimization features in SpiderMonkey are no longer active by default. Mozilla confirmed that the asm.js code will be removed entirely in a future version of Firefox. Users who maintain websites using asm.js will not experience breaking changes, as the code continues to run via the regular JavaScript JIT engine. The move reflects the maturity of WebAssembly, which now provides faster execution and smaller binaries, making asm.js redundant.

Mozilla’s decision is based on the fact that asm.js, a subset of JavaScript designed for near-native performance, was initially developed to run high-performance code on the web, enabling projects like Unity and Unreal to port C/C++ codebases to the browser. The technology shipped in Firefox 22 in 2013 and was instrumental in demonstrating the web’s potential for high-performance applications. Its success paved the way for WebAssembly, which debuted in Firefox 52 and has since become the standard for web-based native code execution.

Why It Matters

This development signifies a major milestone in web technology evolution. By discontinuing asm.js, Mozilla is streamlining its engine, reducing maintenance burdens, and minimizing potential security risks. The shift underscores WebAssembly’s dominance as the preferred method for high-performance web applications, impacting developers and users alike by encouraging migration to more efficient, modern standards.

WebAssembly and Emscripten for High-Performance Web Apps: Practical Techniques and Real-World Projects

WebAssembly and Emscripten for High-Performance Web Apps: Practical Techniques and Real-World Projects

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Background

Asm.js was Mozilla’s response to the challenge of running native-like code on the web, emerging from the needs of projects like NaCl and PNaCl. It was first introduced in Firefox 22 in 2013, enabling complex applications such as 3D games and simulations directly in the browser. Over time, WebAssembly was developed as a more efficient and versatile successor, eventually surpassing asm.js in performance and size. Mozilla’s announcement aligns with the broader industry trend of phasing out older technologies in favor of WebAssembly, which offers better optimization and security features.

“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.”

— Mozilla Developer Blog

“Recompiling to WebAssembly will give you faster execution and smaller binaries, making it the recommended path forward.”

— Mozilla engineer

Mastering Blazor WebAssembly: A step-by-step guide to developing advanced single-page applications with Blazor WebAssembly

Mastering Blazor WebAssembly: A step-by-step guide to developing advanced single-page applications with Blazor WebAssembly

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What Remains Unclear

Details about the exact timeline for complete removal of asm.js support are still emerging. It is not yet clear how many websites or applications remain reliant on asm.js, or how the transition will be managed for legacy content. Mozilla has not specified a precise date for the final removal, only that it will happen in a future release.

WebAssembly and Emscripten for High-Performance Web Apps: Practical Techniques and Real-World Projects

WebAssembly and Emscripten for High-Performance Web Apps: Practical Techniques and Real-World Projects

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

What’s Next

Developers are advised to recompile their asm.js codebases to WebAssembly, which offers better performance and smaller binaries. Mozilla will likely provide tools and guidance for migration. The final removal of asm.js support is expected in upcoming Firefox releases, with further updates on the timeline to be announced.

Javascript: Guia do Programador

Javascript: Guia do Programador

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

Will websites using asm.js stop working after support is removed?

No. asm.js code will continue to run via the standard JavaScript engine, but the optimization support will be gone. For best performance, developers should migrate to WebAssembly.

Why is Mozilla removing asm.js support now?

Because WebAssembly has proven to be a more efficient and capable technology for high-performance web applications, making asm.js largely obsolete.

How can I migrate my asm.js projects to WebAssembly?

Mozilla recommends recompiling your codebases to WebAssembly using available toolchains, which will provide faster execution and smaller binaries.

Will this affect other browsers or just Firefox?

This announcement pertains specifically to Firefox 148. Other browsers may have different support timelines for asm.js and WebAssembly.

What is the future of high-performance web applications without asm.js?

WebAssembly will continue to evolve and support complex, high-performance applications on the web, replacing asm.js entirely.

Source: Hacker News

You May Also Like

The queue. Why the grid, not the chip, is the binding constraint on AI.

AI data center growth is running into grid queues, power availability and interconnection delays, not only chip supply.

Microscale Thermite Reaction

A recent experiment successfully demonstrated a microscale thermite reaction, raising questions about its potential applications and safety implications.

SANA-WM, a 2.6B open-source world model for 1-minute 720p video

SANA-WM, a 2.6-billion parameter open-source world model, can generate 1-minute 720p videos, marking a significant step in AI video synthesis.

The bridge. Why the AI buildout runs on a nuclear story and a gas reality.

Exploring the gap between AI industry’s nuclear procurement rush and the reality of behind-the-meter gas infrastructure filling the power demand now.