3 ms·
> a lot of people want to "compile JS down to wasm" to make it faster. That's bullshit, because your language does not have static types to begin with, so you l
by shusson 9y ago
> a lot of people want to "compile JS down to wasm" to make it faster. That's bullshit, because your language does not have static types to begin with, so you lose the JIT and gain nothing in exchange, which means you'll run much slower.
According to Mozilla's recent blog[1], WASM will in many cases be faster than JIT. In your experience is this not true?
[1] https://hacks.mozilla.org/2017/02/what-makes-webassembly-fast/ https://hacks.mozilla.org/2017/02/what-makes-webassembly-fas...
- sjrd 9y agoI read that article. They do not say anything wrong. But if you read between the lines, the article assumes your source language has types and does not have managed memory. Under those conditions, wasm will beat the JIT every time. But if your language has dynamic types and/or managed memory (but mostly dynamic types), then you need a JIT to get anywhere close to decent performance. The silent assumptions in that quite famous article is one reason many people believe that "compiling JS down to wasm" will make it faster. It is not the only article that has completely failed to point out the limitations, though. It's very sad to see, from where I stand. Note that I am not the only one thinking this. Core wasm developers agree. [1] [1] https://github.com/WebAssembly/design/issues/219 https://github.com/WebAssembly/design/issues/219
- shusson 9y agothanks, TIL. That Mozilla blog is misleading.