[proposals] Exception Handling - initial implementation#794
Conversation
|
Do you plan to merge this before the feature is standardized? Are there any target applications using the feature that you're trying to get running? I read the explainer and skimmed the code. Unless I'm missing something, this seems compatible with the JVM model for exceptions, so this should be fairly straightforward to implement for AOT. |
some higher-level languages are starting to embrace the EH spec, this would enable using them. To be fair, most of those languages would also require WasmGC support, that would be the next step, but we would still need both one day or another, and EH feels like the appropriate first step.
I was planning to give it a try :) |
The proposal should be standardized sometime soon, I think it's safe to merge, we can follow up if there are substantial changes.
I was targeting running Java compiled to Wasm, but it turns out to be using an older version of the spec 😅 and now we are going to need also WasmGC support.
I think it is going to be even easier in the AOT, as you don't need all the walking up the stack logic that is happening here.
Don't fight 😄 , as always I'm available to help making this happen, but since we have 2 volunteers I'll focus on something else. Beware the EH testsuite is also testing the interaction with tail-call, not a lot of work, but it would be the first step. |
|
it is worth noting that the tests for exception handling were incomplete last we checked |
oh sure, if @electrum wants to go at it I won't get in the way ;) |
|
@evacchi I'm not sure if I'd have time to work on this (though it sounds fun), so feel free to give it a go. I'm happy to review or chat about it. The tail-call interaction seems basically impossible for AOT, given that the JVM doesn't support that, so we probably need to permanently skip those tests. |
I don't know if the tests make any real assumption on it being actually a tail call (it's probably more about validation), I think the instructions (return_call etc) will be simply implemented as regular call+return @andreaTP knows more :) |
|
Re: tail call |
I found this when working on #794 , and it's extremely confusing, so separating the fix to get it merged early.
a84f188 to
f197ecf
Compare
|
I updated the PR to get also |
18cd6d8 to
04cdb18
Compare
04cdb18 to
28dca66
Compare
evacchi
left a comment
There was a problem hiding this comment.
we had an offline discussion, we believe the design can be improved, but it's fine for now, we can iterate
|
Going to merge, thanks everyone for the comments and feedback! |
This is an initial implementation of the Exception Handling proposal.
There are rough edges and a few details to be cleared out, but I'm opening early to receive comments.
In particular a review by @SoniEx2 would be appreciated as they implemented it in Wabt. 🙏
Useful links:
I'll comment inline more this implementation tomorrow.