Live data from Hacker News

Saying goodbye to asm.js

spidermonkey.dev

21–30 of 164 posts

Re: Saying goodbye to asm.js

#21
post #7

There goes my plan to use js code generation at runtime to make my algorithms faster. Doing this with wasm will be much harder.

Just try the asm.js subset and see how it performs for you, I remember that even without the special asm.js support in browsers Emscripten output performance was surprisingly good

Re: Saying goodbye to asm.js

#22
Hmmm, 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

#24
post #15

So the death of asm.js is upon us? We are drifting away from the timeline of the prophecy: https://www.destroyallsoftware.com/talks/the-birth-and-death... (And to those who haven't encountered this before, I strongly recommend a watch. It may be the greatest tech talk of all time, for certain values of greatest.)

With this technology's death, the thread of prophecy is severed. Restore a saved game to restore the weave of fate, or persist in the doomed world you have created.

Re: Saying goodbye to asm.js

#25
post #15

So the death of asm.js is upon us? We are drifting away from the timeline of the prophecy: https://www.destroyallsoftware.com/talks/the-birth-and-death... (And to those who haven't encountered this before, I strongly recommend a watch. It may be the greatest tech talk of all time, for certain values of greatest.)

Don't worry, YavaScript will live forever.

Re: Saying goodbye to asm.js

#26

I 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 buffers from js to wasm

I'm pretty sure you can't do that with asmjs either. There is a proposal for zero-copy buffers with wasm: https://github.com/WebAssembly/memory-control/blob/main/prop...

Re: Saying goodbye to asm.js

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

Had it been today, Chrome would have just pushed NaCl and PNaCl no matter what, and then everyone would complain why Safari and Firefox aren't keeping up with "Web" standards.

Re: Saying goodbye to asm.js

#28

asm.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.

Re: Saying goodbye to asm.js

#29
post #7

There goes my plan to use js code generation at runtime to make my algorithms faster. Doing this with wasm will be much harder.

Generating wasm code at runtime is pretty easy (I'd imagine easier than generating valid asm.js code). We have a little library for our tests that handles a lot of it: https://searchfox.org/firefox-main/source/js/src/jit-test/li...

Re: Saying goodbye to asm.js

#30
post #7

There goes my plan to use js code generation at runtime to make my algorithms faster. Doing this with wasm will be much harder.

Just try the asm.js subset and see how it performs for you, I remember that even without the special asm.js support in browsers Emscripten output performance was surprisingly good

In fact, I think it was only firefox that made a special JIT route. Chrome moved optimizations into the regular JIT.
Post reply on HN