Reading the @ziglang documentation and realizing its error handling approach is sincerely the best combination of "checked enumeration" Result and "arbitrary choices" exceptions
-
Show this thread
-
It's extremely cool to have an open set of possible errors, so that any point in the graph can know what failures are able to reach it, and be able to freely add or remove errors to or from that set to handle some or describe others
1 reply 0 retweets 1 likeShow this thread -
"the function below me may return a FileAlreadyExists error, but I handle that, so my caller will never see one I may also return a NotAGitObjectFile error, so my caller may see one of those" WAY better than Rust's inflexible error enums!
2 replies 0 retweets 5 likesShow this thread -
I can't write a Rust function that says, in the type system, "I return (any io::Error except AlreadyExists), or also (filename is not valid in my domain)" because we don't have set arithmetic on enums That's a really cool way to do granular error handling
2 replies 0 retweets 7 likesShow this thread
Oh that sounds quite pleasant!
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.