News for hackers. Stuff that matters.
Re:Making Rust binaries smaller by default by IshKebab on Wednesday January 24, 2024 @08:55AM (#39117373)
You aren't. They're only caught in special cases, e.g. if a thread panics and you want to propagate that to other threads, to catch panics in unit tests, to avoid unwinding across FFI, etc.

You shouldn't use them as a general exception mechanism. They aren't the same, even if under the hood they both use stack unwinding.

Re:Making Rust binaries smaller by default by vacuity on Wednesday January 24, 2024 @01:08PM (#39120606)
Naively, what is the difference between panics and exceptions? Is it the philosophy on when/how to use them?
Re:Making Rust binaries smaller by default by IshKebab on Thursday January 25, 2024 @11:57AM (#39131719)
Yes, and also exceptions can have arbitrary value associated with them. You aren't going to get far using panics as a general error handling mechanism because there's only one type of panic.