Earlier quoted context omitted.
> If WASM would've worked as advertised, allowing fully fledged apps to run easily and natively in the browser with no fuss and 90% native perf, then basically all app stores would've been dead. Working on that! I'm building hypen.space which is platform agnostic language & SDK for building native crossplatform apps. It's a WASM engine at it's core, and while currently it doesn't have "package this app as wasm" capab…
Crediting LLMs with advancing wasm is a disservice to the best-in-industry bytecodealliance community & org.
GC and Exceptions in Wasmtime
41–44 of 44 posts
Re: GC and Exceptions in Wasmtime
#42Earlier quoted context omitted.
NaCL was further along in every meaningful dimension (the ability to run native software at native speeds) after a year or two of development, than WASM is today after a decade (and I think this will be true a decade from now). So the upside of WASM according to you, is that it got greenlit by the standards committee chaired by companies whose business model would've been hurt the most by a competent in-browser sandb…
It seems like you know quite a bit of the history here. Were you involved in some way? If so, I'm curious to know why you think NaCL did not achieve broad adoption? And what's stopping the world from catching up to your line of thinking and adopting a NaCL successor?
Only as a developer using the technology, as part of a failed commercial venture.
> If so, I'm curious to know why you think NaCL did not achieve broad adoption?
NaCl had 2 limitations compared to WASM, the first one was a design philosophy difference:
Unlike WASM, it was designed to maximize compatibility with native code, so it had no ability to coexist in the same process with JS/DOM like WASM does. You had to put the code in an iframe, and talk to it via postMessage. WASM promised to be a better design, but a decade on, we can see it's missing most of those promised features, or said features are half-baked, and it has turned into one of the biggest NIH quests in modern computer science.
The second issue was that it worked through Chrome's plugin API, which has since been deprecated. You could sit down and standardize an API that's not chrome specific. The biggest piece of API surface the browser has is WebGL, and they essentially exposed OpenGL ES to the browser, which is identical to what PPAPI did.
Some APIs were much better, like audio just gave you a buffer to write into, compared to WebAudio, which aims to implement the whole processing pipeline via stringing together JS objects, and everybody seems to hate it.
> And what's stopping the world from catching up to your line of thinking and adopting a NaCL successor?
Theoretically nothing, but you'd have to fork Chrome, do the changes yourself, develop a spec and tooling and THEN ask browser vendors to standardize on your changes. If there was some soul who would undertake this task (maybe feasible with AI for a non-huge team?), combined with a strong awareness campaign to get committees to consider adoption. So it's a tall order in reality.
Re: GC and Exceptions in Wasmtime
#43Earlier quoted context omitted.
It seems like you know quite a bit of the history here. Were you involved in some way? If so, I'm curious to know why you think NaCL did not achieve broad adoption? And what's stopping the world from catching up to your line of thinking and adopting a NaCL successor?
> Were you involved in some way? Only as a developer using the technology, as part of a failed commercial venture. > If so, I'm curious to know why you think NaCL did not achieve broad adoption? NaCl had 2 limitations compared to WASM, the first one was a design philosophy difference: Unlike WASM, it was designed to maximize compatibility with native code, so it had no ability to coexist in the same process with JS/D…
Alternatively, the should've stuck with the NaCL approach of two separate, isolated worlds, with maximum compatibility and peformance for native code.
Re: GC and Exceptions in Wasmtime
#44Wait, what does this mean? > We reuse WebAssembly linear memories under the covers to implement and sandbox the GC heap. A reference to a GC object is not a native pointer, it is a 32-bit index into the GC heap’s underlying linear memory [..] As far as being fast goes, it lets us use virtual-memory guard pages to elide explicit bounds checks, just like we do for linear memories Array loads and stores still need an ex…
With the 4 GiB linear memory trick, WASM's 32-bit pointers can't point outside of the range of virtual memory they allocate for the guest, so from the point of view of host, the guest is unable to have an out-of-bounds reference.
The program running inside the WASM virtual machine can still corrupt its internal state, but that doesn't matter for the WASM engine's security model: the program can be assumed to be directly hostile.
They're saying they used a similar design for WasmGC -- concretely, they're 32-bit indexes to a second span of virtual memory, but opaque and with more rules about how they can be used. They're unforgeable by design, but even if you find a bug in the WASM engine, it's still only a 32-bit index.
The quote extends that 4 GiB thinking to the GC design: Even with a bug in the WASM engine, every index is "safe" to access at any time, eliding bounds checks (the explosion is instant, predictable, and contained).