News for hackers. Stuff that matters.
Re:The road to Dart 3: A fully sound, null safe language by masklinn on Thursday December 08, 2022 @12:09PM (#33910321)
1. An exception is a recoverable error, that's the entire point, that's what catching an exception is.

2. Unlike Go's, rust's panics do not actually, universally, get "propagated up the call stack until they reach a "catch point", where they can be handled by the programmer". There's a compiler flag which can be "unwind" or "abort". In the former case (the default), panics can be caught and recovered from. In the latter case, the program gets hard-stopped on the spot.

Re:The road to Dart 3: A fully sound, null safe language by cwzwarich on Thursday December 08, 2022 @12:25PM (#33910525)
> Unlike Go's, rust's panics do not actually, universally, get "propagated up the call stack until they reach a "catch point", where they can be handled by the programmer". There's a compiler flag which can be "unwind" or "abort". In the former case (the default), panics can be caught and recovered from. In the latter case, the program gets hard-stopped on the spot.

There are Rust libraries (e.g. salsa, used in rust-analyzer itself) that use unwinding internally for non-local control flow and won't work with unwinding disabled.

Re:The road to Dart 3: A fully sound, null safe language by dysarray on Thursday December 08, 2022 @12:16PM (#33910406)
2. In default Rust config, unhandled panics end up unwinding the stack, calling destructors for everything, freeing resources, closing files and sockets, and printing an error message and possibly a stack trace. I think this qualifies as the language runtime automatically catching the exceptions.

3. For 99% of users, panic = unwind in rust. If you play with compiler flags, C doesn't have undefined behaviour because ubsan will abort programs if you compile with the right flags.