Saying goodbye to asm.js
31–40 of 164 posts
Re: Saying goodbye to asm.js
#32Re: Saying goodbye to asm.js
#33Sad day. I have a sha256 hasher in asm.js that's faster than any wasm solution.
Furthermore, if you use wasm, you'll have fewer bounds checks (because of better memory allocation strategies[1]), access to SIMD, bulk memory operations, and a host of other niceties that have been added to wasm over the years. If your asm.js code is outperforming someone else's wasm code, that probably just means their wasm code is worse.
[1]: https://spidermonkey.dev/blog/2025/01/15/is-memory64-actuall...
Re: Saying goodbye to asm.js
#34asm.js is faster than WASM, and it can do everything that JS can do.
Re: Saying goodbye to asm.js
#35I personally think this is a mistake. But I'm not sure how much it matters. It's not like a lot of people were using asm.js still AFAIK. But wasm is too isolated from javascript. From my limited use of it, I was considering trying to compile to asmjs instead. But I wasn't sure that emscripten still fully supported it. You can't call most web apis from wasm. But more important for what i was trying to do, you can't ze…
Re: Saying goodbye to asm.js
#36asm.js is faster than WASM, and it can do everything that JS can do.
Re: Saying goodbye to asm.js
#37Hmmm, need a asm.js -> WASM transpiler maybe. (compiling legacy code with legacy versions of Emscripten is quite frustrating, almost as bad as updating your JS code to be compatible with accumulated changes in the Emscripten ABI)
Re: Saying goodbye to asm.js
#38asm.js is faster than WASM, and it can do everything that JS can do.
Re: Saying goodbye to asm.js
#39I personally think this is a mistake. But I'm not sure how much it matters. It's not like a lot of people were using asm.js still AFAIK. But wasm is too isolated from javascript. From my limited use of it, I was considering trying to compile to asmjs instead. But I wasn't sure that emscripten still fully supported it. You can't call most web apis from wasm. But more important for what i was trying to do, you can't ze…
> But wasm is too isolated from javascript. From my limited use of it, I was considering trying to compile to asmjs instead asmjs is going to be strictly more limited in interacting with JS than wasm. You're basically limited to simple number values and array buffers. Whereas wasm now a days has GC types and can hold onto JS value using externref. > But more important for what i was trying to do, you can't zero copy…
Had WASM not been adopted we would have SIMD in JS ( probably via asm.js) by now. Because we didn't, JS just cannot compete with WASM in many computationally heavy workflows. We'd also have general purpose JS to Asm.js compilation, with few API restrictions, making writing it much easier.
Re: Saying goodbye to asm.js
#40asm.js is faster than WASM, and it can do everything that JS can do.
Faster? I'm not sure about that. Maybe if you are doing a lot of talk between the compiled and JS runtime/DOM. But otherwise WASM has been much further developed in both Firefox and Chrome. I don't think Chrome ever did an asm.js specific optimization.