this post was submitted on 01 Aug 2025
149 points (96.9% liked)
Programmer Humor
25425 readers
1034 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I don't think that's a valid comparison. The behavior does differ when it comes to cleanly releasing resources. Rust's panic performs the drop actions for the current values on the stack, a SIGILL or SIGSEGV crash doesn't.
Try it yourself
That’s fair, although technically you could catch SIGSEGV and release resources that way too.
Also, given that resources will be reclaimed by the OS regardless of which kind of crash we’re talking about, the effective difference is usually (but not always) negligible.
Either way, no user would consider a
panic!()
to be not a crash because destructors ran. And most developers don’t either.