News for hackers. Stuff that matters.
Re:Notes on a Smaller Rust by wtetzner on Thursday July 18, 2019 @08:49AM (#20469183)
What benefits are there to checked exceptions over Rust's `Result` type?
Re:Notes on a Smaller Rust by barrkel on Thursday July 18, 2019 @09:53AM (#20469760)
Automatic propagation without relying on macros like try!, or match with return on Err case.

As you make it easier to propagate the error case to the caller, you asymptotically reach checked exceptions.

Re:Notes on a Smaller Rust by wtetzner on Friday July 19, 2019 @11:12AM (#20479279)
I guess, although I'm not convinced that's an advantage. The ? syntax is pretty convenient, and it still allows you to do manual matching if you have a good reason to.

I think the main thing you'd gain with checked exceptions is being able to list the possible failures in the function signature, instead of having to create an enum type. But I guess I'm not sure it's really worth the tradeoff.

Re:Notes on a Smaller Rust by Rels on Thursday July 18, 2019 @09:54AM (#20469770)
Strack traces? I love Rust error handling, but the one thing I sometimes miss is that there is no stack traces by default on errors.
Re:Notes on a Smaller Rust by roblabla on Thursday July 18, 2019 @10:00AM (#20469832)
That's orthogonal to exceptions though. Errors could easily have stack traces automatically added to them (and IMO, they should).