Open SoniEx2 opened 2 months ago
Thanks for opening this issue!
The specific pattern is usually called "non-local control flow".
I have a few questions/doubts about enabling this functionality, at this stage of the project.
If you are able to share a concrete use case(although slow) it will be great, so that we can continue the discussion being sure we are on the same page.
Sure! Running pre-EH emscripten modules that make heavy use of setjmp/longjmp, for starters. (Does chicory even support wasm EH at this point?) This includes things such as Lua.
Does chicory even support wasm EH at this point?
Not yet, if I understand it correctly we can evaluate this request after we have a more solid exception handling story.
Yes, the pre-EH system exists for runtimes that don't support EH, like Chicory. Except it doesn't work with Chicory properly. Unless you implement it on top of Error
.
It would be nice to have some way to pass (most) exceptions through, instead of having them wrapped in
WASMMachineException
.In particular because
WASMMachineException
is extremely slow for the things this little special constructor enables one to do. The specific pattern is usually called "non-local control flow".Granted, one can still use
Error
for this purpose, sinceError
has similar semantics toRuntimeException
and also includes the appropriate constructor. And usingError
for "normal occurrences" isn't completely unheard of.