News for hackers. Stuff that matters.
Re:Rust: Enums to Wrap Multiple Errors by nemothekid on Friday October 08, 2021 @12:46PM (#28801260)
Calling exceptions "Go envy" or a "mistake" seems like naive criticism. Ignoring the fact that the Rust is as old as Go; there is a lot of time spent in building language features with an, from my point of view, academic level of rigor.

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...

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.
Re:Rust: Enums to Wrap Multiple Errors by pjmlp on Friday October 08, 2021 @01:58PM (#28802133)
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.