HN
Today

Saying Goodbye to Asm.js

Mozilla's SpiderMonkey is officially deprecating asm.js optimizations, marking the end of an era for a foundational web technology that proved native-like performance was possible in the browser. While existing asm.js code won't break, developers are encouraged to migrate to WebAssembly for superior performance and maintainability. Hacker News readers are reflecting on asm.js's legacy and discussing surprising corner cases where it might still outperform its successor.

23
Score
7
Comments
#3
Highest Rank
11h
on Front Page
First Seen
May 20, 1:00 PM
Last Seen
May 20, 11:00 PM
Rank Over Time
94543589101216

The Lowdown

Mozilla's SpiderMonkey engine is phasing out its optimizations for asm.js, a significant step in the evolution of web technologies. Originally introduced in 2013, asm.js enabled near-native speed execution of C/C++ code on the web using a strict JavaScript subset, paving the way for the more robust WebAssembly (Wasm). This deprecation, announced with Norse mythological flair, reflects the success of Wasm and Mozilla's commitment to reducing maintenance overhead and attack surface.<ul><li><b>Axe-time for Asm.js:</b> Firefox 148 disables asm.js optimizations by default, with full removal planned.</li><li><b>No Breakage:</b> Existing asm.js code will continue to function via the regular JavaScript JIT, but recompiling to WebAssembly is recommended for better performance and smaller binaries.</li><li><b>Historical Impact:</b> Asm.js was a groundbreaking solution to bring native-speed code to the web, enabling projects like Unity and Unreal to run C/C++ on browsers and directly inspiring the creation of WebAssembly.</li><li><b>WebAssembly's Reign:</b> With WebAssembly's widespread adoption and advanced pipeline (OdinMonkey giving way to BaldrMonkey and RabaldrMonkey), the maintenance cost and security implications of supporting asm.js no longer justify its retention.</li></ul>The story serves as a poetic eulogy to a technology that, though superseded, played a crucial role in shaping the modern web's capabilities, demonstrating that what was once a clever hack could lay the groundwork for a new standard.

The Gossip

Performance Puzzles & Wasm Woes

Users expressed surprise and concern regarding performance implications. One commenter claimed their custom asm.js SHA256 hasher was "10x slower" when rewritten in WebAssembly, sparking a debate about specific use cases and requesting to see the code. Another noted that runtime JavaScript code generation for performance, easier with asm.js, would be much harder with WebAssembly.

Legacy & Lore Acknowledgement

A few comments briefly acknowledged the historical significance and the article's playful, Norse-mythology-themed narrative. This included a simple salute to asm.js and an appreciation for the "monkey prints" imagery and its connection to open-source history.