Replies: 1 comment
-
|
Moved to issue #8 |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
I love the idea of a Rust compatible gc language. But one of the things I like about Rust is explicit error handling over try/catch. I understand the appeal of try/catch for fast iteration and I wonder if there is a middle ground. For this type of language, I don't think explicitly stating the error type matters. Thus something like anyhow's
Result<T>would be a nice idea.I think we could improve this further though. I really like Zig's error handling (
!likeResultand?likeOption). Thus it could look likeGoing a step further, if we went with this route, we could handle
Optionthe same wayThe above function essentially returns a
Result<Option<str>>.All this together we could make error handling really nice:
These concepts also map well to Rust. If we ever expose calling otter functions from rust, this
would become something like the following on the rust side
Beta Was this translation helpful? Give feedback.
All reactions