3 ms·
But why use JavaScript engine as the “base”? Why not a more “general” VM? WASM just skips the JS to JIT compiled bytecode - correct me if I’m wrong. Creating a
by nemo846 8y ago
But why use JavaScript engine as the “base”? Why not a more “general” VM?
WASM just skips the JS to JIT compiled bytecode - correct me if I’m wrong. Creating a standardized bytecode for distribution that other languages can compile to.
No reason to continue to shackle the web to JavaScript.
- didibus 8y agoI'm no expert, but I think one issue is the lack of a GC in WASM. So each language have to roll their own custom GC on top of it. Another reason is JS already has many high level features. Which might make it easier to implement similar ones in your language if you target JS directly. The last reason I can think of is interop with existing JS code and the DOM.
- TotempaaltJ 8y agoA GC for wasm is planned, as is DOM/browser API interop.
- zaarn 8y agoThese things are on the roadmap atm. Better WASM/JS interop is on the way, though atleast on Firefox nightly you can get this for fairly low cost for some functions. GC is also on the todo list and IIRC might get an early preview in Firefox Nightly. Once the GC is done, DOM integration will happen, people are eager for that and that would eliminate a lot of the necessary JS glue code.
- jbergens 8y agoHere is a pretty good explanations of the WASM roadmap and why they want certain things. https://hacks.mozilla.org/2018/10/webassemblys-post-mvp-future/ https://hacks.mozilla.org/2018/10/webassemblys-post-mvp-futu...