Rust used to actually have conditions for stuff like IO errors, but having three different ways of doing error handling in one language was a bit much (results, panics, conditions). could probably elaborate…
Conversation
Perhaps if the only way of handling errors was conditions then folks would have learned it properly and liked them, but at the time they were always this 'annoying backwater that you had to deal with when doing IO'.
1
Here's a broken reddit link to a now dead page: reddit.com/r/rust/comment - would need to do more digging to find it - possibly in the git repo.
1
cc. - interesting thread here - know of any good ways to get to ancient Rust documentation?
3
i see... sorta wish that error-by-return-code had been the one removed instead of conditions *_*
1
I'm not so sure - I guess I'm more of a fan of monadic error handling. Rust's lack of extensible variants can make managing all your error types abit annoying, I'll admit. The failure crate makes this nicer, but then you're effectively shelling out to dynamically typed errors.
1
2
Yeah.... monadic error handling sounds like the way we really "want" to be doing things. Now we just need to figure out a way to present monads so that people can understand what they are without reading 9 blog posts...
1
We sometimes refer to it as "monadic", but it looks more like statically typed and manually propagated exceptions - see doc.rust-lang.org/nightly/book/s (also, it's not in stable yet, but on nightly you can use a `Result` type for `main` too, which will simplify many of these examples)
2
3
Oh, you mean, this is a thing in rust and not "I like monads" ad a generic statement?
What is the practical difference better this new monadic style, and conditions?
2
Yeah, the 'pattern' of how you use `Result`s is monadic. Sorry, I slipped in the technical terminology by accident.
1
I never really understood conditions well enough tbh. So I guess my value statement also was from a point of ignorance. I'm guessing many folks were in the same boat at the time when they were removed.


