3 ms·
> I'm personally not aware of languages that completely remove exceptions from the language. Zig is one. For that matter standard C has no exceptions
by jibal 10mo ago
> I'm personally not aware of languages that completely remove exceptions from the language.
Zig is one. For that matter standard C has no exceptions
- teo_zero 10mo agoI'm sure undefined behavior counts as an exception in the meaning intended in TFA. Example: int inv(int x) { return 1/x; }
- jibal 10mo agoNo, it certainly doesn't.
- kennykartman 10mo agoWell, no, you're mistaken about Zig. There are custom panic handlers which are some kind of exceptions. I think Rust has something similar.
- jibal 10mo agoI'm not mistaken. Panic handlers are not any kind of exception.
- kennykartman 10mo agoI general I don't agree with that view, but indeed exceptions can be defined in different ways. An exception doesn't need to have a dedicated keyword or a glorified syntax to be one: if it's something that traverses the stack, has a handler or occurs on exceptional events, it's fair to call it an exception. A language doesn't have to support idiomatic use of exceptions for workflow control (such as C++) to have exceptions. Panic handlers, signals and interrupts might be defined exceptions as well. There are languages, such as Pony, that strive to have no runtime exceptions whatsoever. Not even panic handlers.