News for hackers. Stuff that matters.
Re:Why I Use Elm in 2023 by Georgelemental on Tuesday May 23, 2023 @11:33AM (#36045799)
> Exceptions are ways to crash the program in a controlled manner with the ability for these crashes to be caught midway before the program crashes and handled correctly.

> In rust you can only crash it explicitly using the panic! Macro. No handling.

You can catch Rust panics with `catch_unwind()` if you compiled your program with `-Cpanic=unwind` (default on most platforms). Under the hood it uses stack unwinding, just like C++ and co, exceptions. But Rust doesn't consider this idiomatic error handling, it's only used in a few special situations (biggest ones are test frameworks, and web servers where one buggy session shouldn't take down the process).

There are no comments on this comment yet.