-
Notifications
You must be signed in to change notification settings - Fork 913
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 #891
Comments
"Little used" is relative, it is little used compared to many other language features. I personally don't like At the moment, you can in fact use |
That makes sense, just highlighting its use for custom control flow. It also looks like you have reimplemented or do not support most of the stdlib functionality that would be affected, but I thought I would document the usages that I found:
|
There are some other cases where |
So far, we have managed to compile quite a lot of code correctly without needing it. I still think it is not used a lot. Compare it for example with the Unfortunately it's not as simple as just implementing this feature. Implementing Honestly I think I would need to see a good practical use case before adding this feature. So far I haven't really seen one where |
The argument I am trying to make is more about interop. Today tinygo cannot use most of the code that exists as part of the go ecosystem. If you are writing a few lines of code to run on a microcontroller, this is fine, but it means tinygo is not go. I sympathise with the desire to target microcontrollers and am not suggesting that |
Here is a PR that implements this feature on most architectures: #2331 |
#2331 has been merged, so we will close this issue after the next release. Thanks! |
@deadprogram should a new issue be opened for |
@Vilsol that is a very good idea. Can you please create the issue to track it? |
While
recover
is called out as a little used feature in the docs, it is unfortunately widespread as a custom control flow primitive, seeencoding/gob
01. It has also been clarified and approved by the Go authors as canonical, see #35093.The text was updated successfully, but these errors were encountered: