Live data from Hacker News

GC and Exceptions in Wasmtime

bytecodealliance.org

11–20 of 44 posts

Re: GC and Exceptions in Wasmtime

#11
post #9

Earlier quoted context omitted.

Ready for what? WASM is already running in production at a whole bunch of financial services orgs and government infra. The thing is, it's not running anywhere near HTML, CSS or JavaScript. It's running serverside, mostly on Wasmtime - which, as it happens, is what this post is all about.

why.... why would financial services orgs and government infra run anything on wasm serverside?

It's lightweight, capability-secured, services start up way faster, smaller overhead than VMs, better isolation than containers, faster replication, etc.

The original Wasmtime 1.0 blog post explains it all really well: https://bytecodealliance.org/articles/wasmtime-1-0-fast-safe...

Re: GC and Exceptions in Wasmtime

#12

WASM will be ready when GNU Hurd succeeds in running the desktop linux of the year. Already 10 years since WASM ... HTML, CSS and JavaScript all had a huge influence. WAS simply has not done so yet.

Yeah, WASM has been a disappointment, and I guess there's a good reason for that. 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.

Native Client, which ran native x86 (but statically verified) code in the browser, basically fit all the criteria, except it wasn't platform agnostic. I'm not married to their approach, but I refuse to believe that this can't be done in a safe and peformant manner.

I guess WASM turned out to be a sandbagging rather than sandboxing technology.

But I eagearly await the arrival of concern trolls who can explain why WASM is slower than JS, and why native threading support is impossible to do securely without imposing limitations, that made sites like itch turn it off, so it might as well not exist.

Re: GC and Exceptions in Wasmtime

#13
Just checked and out of the 3 major non-JS GC languages, Go and .NET aren't planning to support WASM GC due to non-matching semantics. There's an implementation for Java - TeaVM, which is an AOT Java compiler, that does have production grade support, but isn't aiming for full Java compatibility (not sure what this means in practical terms).

Native interop with JS objects on the JS GC heap isn't supported as well.

Re: GC and Exceptions in Wasmtime

#14

Just checked and out of the 3 major non-JS GC languages, Go and .NET aren't planning to support WASM GC due to non-matching semantics. There's an implementation for Java - TeaVM, which is an AOT Java compiler, that does have production grade support, but isn't aiming for full Java compatibility (not sure what this means in practical terms). Native interop with JS objects on the JS GC heap isn't supported as well.

Links to discussions about why WASM GC in its current state is not suitable for .NET: https://github.com/WebAssembly/gc/issues/77

What should be improved: https://github.com/dotnet/runtime/issues/94420

Re: GC and Exceptions in Wasmtime

#15

WASM will be ready when GNU Hurd succeeds in running the desktop linux of the year. Already 10 years since WASM ... HTML, CSS and JavaScript all had a huge influence. WAS simply has not done so yet.

Yeah, WASM has been a disappointment, and I guess there's a good reason for that. 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. Native Client, which ran native x86 (but statically verified) code in the browser, basically fit all the criteria, except it wasn't platform agno…

> 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" capability but supports streaming/local apps only, that capability is currently being developed - together with WASI layers for all of the platforms.

That way your app can run either as a browser (DOM) app, browser canvas app, native desktop or native mobile app.

It's still early, but moving fast - I just added accessibility support, and the animation framework will be out this week.

Regarding the WASM disappointed, when I started building this about 6 years ago, WASM was in a terrible (barely usable without wasting a ton of time) state. Now that WASI 0.3 is out and LLMs have sped up development by a large margin, it's in a quite usable state to ship things to production without fear.

Re: GC and Exceptions in Wasmtime

#16

WASM will be ready when GNU Hurd succeeds in running the desktop linux of the year. Already 10 years since WASM ... HTML, CSS and JavaScript all had a huge influence. WAS simply has not done so yet.

I'm not sure why people are claiming wasm isn't ready. It's just a compiler target like asm.js was. And that's been in use pretty much from the start when they got Unreal Engine, Unity, ffmpeg ported to it. Personally I've run Python + Sympy, Xcas/Giac and Maxima in the browser through this amazing tech.

Re: GC and Exceptions in Wasmtime

#17

WASM will be ready when GNU Hurd succeeds in running the desktop linux of the year. Already 10 years since WASM ... HTML, CSS and JavaScript all had a huge influence. WAS simply has not done so yet.

Ready for what? WASM is already running in production at a whole bunch of financial services orgs and government infra. The thing is, it's not running anywhere near HTML, CSS or JavaScript. It's running serverside, mostly on Wasmtime - which, as it happens, is what this post is all about.

> it's not running anywhere near HTML, CSS or JavaScript

There’s plenty of usage in the browser environment as well, plenty of client-side SDKs for things like e.g. video editing, barcode scanning, etc. use it.

Re: GC and Exceptions in Wasmtime

#18
post #14

Just checked and out of the 3 major non-JS GC languages, Go and .NET aren't planning to support WASM GC due to non-matching semantics. There's an implementation for Java - TeaVM, which is an AOT Java compiler, that does have production grade support, but isn't aiming for full Java compatibility (not sure what this means in practical terms). Native interop with JS objects on the JS GC heap isn't supported as well.

Links to discussions about why WASM GC in its current state is not suitable for .NET: https://github.com/WebAssembly/gc/issues/77 What should be improved: https://github.com/dotnet/runtime/issues/94420

I'm not familiar with the current spec and those posts are from 6/3 years ago, respectively. Do you happen to know if anything has changed since?

Re: GC and Exceptions in Wasmtime

#19

WASM will be ready when GNU Hurd succeeds in running the desktop linux of the year. Already 10 years since WASM ... HTML, CSS and JavaScript all had a huge influence. WAS simply has not done so yet.

Yeah, WASM has been a disappointment, and I guess there's a good reason for that. 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. Native Client, which ran native x86 (but statically verified) code in the browser, basically fit all the criteria, except it wasn't platform agno…

There's a big gap between WASM has issues/limitations, and WASM "might as well not exist." NaCL was also Chrome-only IIRC, whereas WASM is a successful web standard (no small feat).

Re: GC and Exceptions in Wasmtime

#20
post #2

It seems like a bit of a shame that wasm got support for exceptions but doesn't support effects which are a generalisation of the same concept. https://wasmfx.dev/ I'm guessing this may be because exceptions exclusively require stack unwinding where as effects require full stack switching. Seems like there is still progress on that though which gives hope https://github.com/WebAssembly/stack-switching/blob/main/pro..…

Looking at the link, it was quite an eye-opener moment (atleast for me) to see so many language-differentiating features - exceptions, async/await, continuations, generators - can all just be abstracted into one concept called "typed continuations". I'm still wrapping my head around this.

On one hand, I'd assume a "focused" feature, like exceptions, would always be easier to fine-tune and optimize the language, runtime and workflow – rather than generalizing it.

But at the same time, the prospect of saying all those are just special forms of a stacked "yield" (just for my mental model) is quite tantalizing.

Post reply on HN