> the runtime is both slower to load, run and is significantly more complex than NaCL ever was, while suffering from lots of limitations, meanwhile WASM code exists separated from the JS runtime. It's high level features like garbage collection, aren't really usable by language runtimes.
Basically everything in this sentence is false. Wasm runtimes are simpler than NaCl, which required an entire LLVM. They start faster, with lazy compilation, interpreters, parallel concurrent compilation, and dynamic tier up. It has fewer limitations than NaCl--it supports SIMD, can access all JS and browser APIs, and didn't require rearchitecting the browser. It's not separated from the JS runtime--all the browser engines use the same compilation, GC, and runtime infrastructure. The high-level features like GC that you mention not being usable from language runtimes are being used by Scala, Kotlin, and OCaml, with more coming.
I shipped the first versions of Wasm in Chrome, and it's true startup wasn't great. Initially, we compiled all Wasm with the top tier before starting. V8 doesn't do that anymore, nor do any other runtimes. Startup is better, topline performance is better, and integration with JS is better.
And did I mention that Wasm also runs in lots of other places?
The crippling problem with WASM is that all data must be serialized prior to calling a JS library. You can't just call the API directly. It causes massive overhead and performance problems, making a data-intense "pure" WASM application very slow.
Edit: The problem is very evident if you need to graph 1000s of points. Calling fetch (js-space API) has to translate data to something your WASM language can handle, then after parsing it in WASM there's overhead either for serializing the data into something the JS graphing library can handle, or overhead for passing raw HTML through js-space.
It's true that there are plenty of APIs that require JS objects, but for anything that takes an ArrayBuffer, you can get export a Wasm memory that has a .buffer property and then slice it however you like; no copying and no serialization.
Basically everything in this sentence is false. Wasm runtimes are simpler than NaCl, which required an entire LLVM. They start faster, with lazy compilation, interpreters, parallel concurrent compilation, and dynamic tier up. It has fewer limitations than NaCl--it supports SIMD, can access all JS and browser APIs, and didn't require rearchitecting the browser. It's not separated from the JS runtime--all the browser engines use the same compilation, GC, and runtime infrastructure. The high-level features like GC that you mention not being usable from language runtimes are being used by Scala, Kotlin, and OCaml, with more coming.
I shipped the first versions of Wasm in Chrome, and it's true startup wasn't great. Initially, we compiled all Wasm with the top tier before starting. V8 doesn't do that anymore, nor do any other runtimes. Startup is better, topline performance is better, and integration with JS is better.
And did I mention that Wasm also runs in lots of other places?
Replies (1)
That's highly misleading.
The crippling problem with WASM is that all data must be serialized prior to calling a JS library. You can't just call the API directly. It causes massive overhead and performance problems, making a data-intense "pure" WASM application very slow.
Edit: The problem is very evident if you need to graph 1000s of points. Calling fetch (js-space API) has to translate data to something your WASM language can handle, then after parsing it in WASM there's overhead either for serializing the data into something the JS graphing library can handle, or overhead for passing raw HTML through js-space.
Replies (1)