← Back to context

Comment by stmw

9 hours ago

Fair point re: Zig vs Rust, but my larger point was about exceptions by any other name, in the linked article:

"Instead, when returning an error, rather than jumping to the return address, we look it up in the side table to find a corresponding error recovery address, and jump to that. Stack unwinding!

The bold claim is that unwinding is the optimal thing to do! .."

If by "exceptions" you're talking about stack unwinding (as opposed to the language-level control flow constructs like throw/catch) then Rust has always had that with panics and panic=unwind.

  • I am talking about the wider category that includes stack unwinding as an error handling pattern for errors outside of catastrophic. T

    My opinion (which one need not approve of) is that it asymptotically approaches the language-level control flow constructs.