Ryan Hunt
Ryan Hunt
I added #282 for some details on the exnref type. Feedback appreciated.
I have a working implementation in SpiderMonkey that I hope to land soon. I had to fill in some binary details and some small execution semantics. I tried to summarize...
> That mostly seems to match what I defined [here](https://github.com/WebAssembly/exception-handling/blob/exnref-1b/proposals/exception-handling/Exceptions.md) and implemented in the reference interpreter, except for the choice of [opcodes](https://github.com/WebAssembly/exception-handling/blob/exnref-1b/proposals/exception-handling/Exceptions.md#changes-to-the-binary-model). I don't feel strongly about those, but if...
> About the `catch_drop` optimization, would it be effective when the whole program uses it, or it's worth it if only a part of the program uses it? In Emscripten...
So JS code can do things like: ```js throw 'JS string primitive'; ``` and wasm can catch that and receive an exnref: ```wasm block $l (result exnref) try (catch_all $l)...
@keithw Ah, good point. I did not know that wasm2c implemented `externref`, is that a GC or ref-counted value? What is it used for?
> Ah ok, I misunderstood. This makes sense, thanks! Do we expect that such an `exnref` is catchable with tag `externref` (to immediately get at the `externref` view of the...
@rossberg I think that could work, but I'll need to think about it more. I'm a bit nervous that long-term the implicit WebAssembly.Exception wrapping of JS values could become accidentally...
Another reason in favor of having JS values auto-boxed in a WebAssembly.Exception is around null. In JS it's valid to throw/catch null: ``` try { throw null; } catch (value);...
> It's also not possible to emulate `return_call` in core Wasm. Perhaps the person asking was missing that tail calls are more general than just tail recursion? I'll just talk...