3 ms·
Both Rust and Go are good examples of modern languages with no exceptions. Not coincidentally, both provide a panic mechanism, which is intended for failures t
by antonvs 10mo ago
Both Rust and Go are good examples of modern languages with no exceptions.
Not coincidentally, both provide a panic mechanism, which is intended for failures that are either unrecoverable or at least not locally recoverable. Both languages allow you to "catch" panics, but this mechanism is constrained and impractical to use for normal error handling. Instead, it's used to e.g. prevent a service from crashing if individual requests fail unrecoverably.
The point is that these languages both demonstrate a simple design for exception-free languages.
(Although Rust's approach is better in several ways, partly because it has a better type system.)