news.volyx.in

Saying goodbye to asm.js (spidermonkey.dev)

410 points by eqrion · 101 days ago · 158 comments on HN

Article summary

Mozilla's SpiderMonkey JavaScript engine is disabling asm.js optimizations by default in Firefox 148 and plans to remove the code entirely in a future release. asm.js was a subset of JavaScript that allowed for near-native speed execution, but its usage has mostly migrated to WebAssembly. The removal of asm.js is due to the success of WebAssembly and the maintenance costs of keeping both paths. Developers are encouraged to recompile their asm.js code to WebAssembly for better performance and smaller binaries.

Main themes

  • asm.js deprecation
  • WebAssembly adoption
  • JavaScript performance
  • Browser engine optimization
  • Code compilation

What commenters say

  • The deprecation of asm.js may not affect performance significantly, as it is just a subset of JavaScript and can still run without optimizations.
  • Some developers have found that their asm.js code performs better than equivalent WebAssembly code, particularly in certain browsers.
  • The removal of asm.js is a natural step due to the success of WebAssembly, which offers better performance and smaller binaries.
  • Generating WebAssembly code at runtime can be easier than generating asm.js code, and libraries are available to simplify the process.
  • The rise of AI may have impeded the adoption of WebAssembly as a universal compilation target, as AI can generate JavaScript code directly.
  • WebAssembly has limitations, such as poor IR design and inability to call JavaScript APIs with no overhead, which may hinder its adoption.
  • The death of asm.js marks the end of a prophecy that predicted WebAssembly would become the dominant compilation target, but this was disrupted by the rise of AI.
  • Despite its limitations, WebAssembly has made significant progress and now supports 64-bit and multithreading, making it a viable option for many use cases.