-
Notifications
You must be signed in to change notification settings - Fork 914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement recover for wasm architecture #2914
Comments
wasm
architecture
wasm
architecture
Few points which could lead to a better description and possibly another way out. Summarizing the technical concernThere are a mix of opinions and technical concerns in the 60+ comments in the PR preceding this. It would be nice to have a summary here about what is a technical constraint vs a cultural disinterest in blocking on incomplete WebAssembly proposalsWhile some land faster than others, blocking on WebAssembly proposals can prevent implementation for periods of a year or more. The good news is that the proposal mentioned here is at least in phase 3, so it is more likely a when vs if, though it is possible still to be canceled before "finished". https://github.com/WebAssembly/proposals How do others get by?I tried the test data in normal go |
To add a use-case, when compiling with the go compiler, it allows us to recover from panics by displaying a relevant message in the browser. |
You are correct, but note that the Go toolchain emits very different WebAssembly than TinyGo does. And as a result, TinyGo often makes much smaller binaries. I haven't really looked into how it works to be honest, but can't think of a way to implement recover without many changes to the compiler for a feature that is going to be relatively short-lived (the exception handling proposal is certainly the better way to implement recover). We implemented goroutines using a big giant hack called Asyncify. We can maybe do the same for defer/recover, although the cost/benefit ratio seems far higher for recover.
While frustrating, I think this is the most reasonable way forward. Correct me if I'm wrong, though. I'd love to have |
Hi there, I'm reaching out to kindly inquire if there have been any recent developments or updates regarding this matter. Considering that we're now in 2024 and exception handling is nearly a standard feature in mainstream browsers, I'm curious to know if there have been any changes or advancements in TinyGo's implementation of recover for the WASM target. Thank you for your attention to this, and I look forward to any information you can provide. |
Got caught by a |
I have implemented
EDIT: see #4380 |
recover
was implemented for most architectures in #2331, howeverwasm
was left out.As suggested here
tinygo/compiler/defer.go
Lines 29 to 33 in 4c64784
Opened as per expected closure of #891
The text was updated successfully, but these errors were encountered: