3 ms·
All these workarounds for easier Result handling truly make me wonder whether Rust will eventually evolve exceptions as a feature - of-course without explicitly
by lenkite 4y ago
All these workarounds for easier Result handling truly make me wonder whether Rust will eventually evolve exceptions as a feature - of-course without explicitly terming them so.
- steveklabnik 4y agoThe community would revolt. Not going to happen. Proposals to make the existing syntax and semantics even look more like exceptions were met with lots of hostility.
- FpUser 4y agoRevolt how? Go back to C++ or whatever language/s they were using?
- steveklabnik 4y agoI don't know exactly, but it's never pretty when a project's leadership makes an unpopular decision. Lots of complaining, for sure.
- tomp 4y agoRust already has exceptions, they just call them panic and offer exceedingly poor language support for them. Some people simply live in denial, believing untruths that confirm their worldview. This is the same situation as with Go and generics. The maintainers were in denial for a very long time, before finally admitting what was obvious to some of us long before [1] [1] https://news.ycombinator.com/item?id=8626978 https://news.ycombinator.com/item?id=8626978
- xcdzvyn 4y agoThe implementation, outcome, use-case, and characteristics of panics are all very different from exceptions. The only marked similarity between the two is that they both interrupt program execution (and in different ways). But I feel as if you already knew that.
- tomp 4y agoPanics support stack traces, unwind the stack, releases the memory, and can either be recovered in some situations, or prints an error message. Sounds like Python exceptions.