logoalt Hacker News

stkdumpyesterday at 1:30 PM5 repliesview on HN

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


Replies

eqrionyesterday at 2:35 PM

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

giancarlostoroyesterday at 1:53 PM

There's still AssemblyScript? It might meet your requirements, unless I'm misunderstanding you or the features of it.

https://www.assemblyscript.org/

flohofwoeyesterday at 2:09 PM

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

show 1 reply
titzeryesterday at 2:05 PM

It will still work. asm.js is just regular JavaScript code, after all. It just won't parse/run as fast as custom pipeline for asm.js. My guess is that you will not notice much difference unless you have a really huge application.

koolalayesterday at 2:03 PM

There are some WAT compilers that are small and fast for running in the browser.