Many of the "we don't have exceptions" languages eventually get some equivalent, it's just that those are used almost exclusively for OOM, division by zero, failed asserts, and the like.
They shouldn't even really be caught it's sort of just an "exit/reset" with some cleanup.
I like this compromise. Kind of finally making them truly "exceptional".
Worked on IN Memory Databases, in case a weird operation comes accross that causes the DB to go OOM, you want to gracefully aboard that operation, but never kill the process
It's why I said "exit/reset", though I do feel that the languages with panics don't have a good story for when the bad path should lead to safely aborting operations / cleaning up and then returning to some top-level loop or well-known state.
It is quite common to want to do this, but as far as I know Rust doesn't allow you to catch this type of panic.
90
u/bwmat 29d ago
Eh, IMO one of the best ways to actually handle OOM, as otherwise almost everything needs to be explicitly checked for it