WASM support for exceptions #144
gbryant-arm
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
By design, WASM can't be tied to a specific embedder. Moreover, languages/compilers have their own definition of what an exception is.
As a result, exceptions aren't supported in WASM directly, although a proposal to natively support zero-cost exceptions is in the works (https://github.com/WebAssembly/exception-handling).
A workaround consists in implementing exception handling in the embedder. Emscripten, for instance, implements C++ exception handling (setjmp and longjmp among other functions) in the JavaScript glue code. It comes with a significant overhead, as a shim gets inserted into every function that can throw.
Beta Was this translation helpful? Give feedback.
All reactions