4 ms·
> WebAssembly probably won't [have a GC] for some time Citation needed :) > It also doesn't have ~20 years of performance tuning on different microarchitectur
by pcwalton 11y ago
> WebAssembly probably won't [have a GC] for some time
Citation needed :)
> It also doesn't have ~20 years of performance tuning on different microarchitectures the way the JVM does.
JS engines have been tuned very well over the years. Remember that Web Assembly is designed to run in a JS engine.
- pron 11y ago> Remember that Web Assembly is designed to run in a JS engine. Is it? It's a very low-level bytecode that's designed to be efficiently compiled in one pass, and completely unrelated to the JS engine. It isn't meant (at least at this time) to have an optimizing JIT (like HotSpot or V8). It is meant as a good target for languages that don't rely on/can't benefit greatly from good JIT optimizations, such as C/C++ (or Rust). Of course, one could compile a JVM to wasm, provided that wasm allows applications to write to executable memory (which I doubt).
- sunfish 11y agoIt is (though that's not the only thing it's designed for), but in a JS engine setting it only uses a few specific parts of the JS engine, such as the JIT backend to do the actual code generation work and interoperability with JS. Indeed, wasm won't likely ever expose directly executable memory. But in the future it may expose JIT capabilities like creating and calling new functions, declaring "patchable" code fragments which can be manipulated through APIs, and so on, and with these capabilities it isn't unreasonable to think about porting JITing VMs onto wasm.