Re:Rust: Enums to Wrap Multiple Errors
by kevinmgranger on Friday October 08, 2021 @12:56PM
(#28801366)
Besides, Result types with sufficiently advanced ergonomics might as well be semantically identical to exceptions.
The so called "Java design" as urban myth, traces back to CLU, Mesa/Cedar, Modula-2+, Modula-3, and C++.
Naturally the Java designers thought to adopt a feature that was increasingly being made available.
And they only got out of C++ due to the language dialects out there regarding RTTI and exceptions.
There have been a lot of RFCs discussing exceptions in Rust[1][2][3], and the tradeoffs and design have been discussed thoroughly. If you have a design in mind that is safe, robust and performant you are welcome to submit one - as my understanding is the Rust team does not have an ideological slant against exceptions.
I've never understood the hard-on by some C++ fanboys to rush exceptions. You can build (IMO) more reasonable code without abusing ~~gotos~~ exceptions, and a bad exception design (like Java's) is strictly worse than even Go's error handling.
[1] https://github.com/rust-lang/rfcs/pull/243
[2] https://github.com/glaebhoerl/rust-notes/blob/268266e8fbbbfd...
[3] https://github.com/rust-lang/rfcs/blob/master/text/0243-trai...