News for hackers. Stuff that matters.
Re:I Believe Zig Has Function Colors by anonymoushn on Saturday April 09, 2022 @08:11AM (#30967338)
One reason checked exceptions are a not great is that library authors would like you to implement their interfaces or extend their classes, but they've decided that you can't throw anything :)

Zig actually does pretty well on this front. you can write a library that accepts functions that return errors, and your functions will be specialized to return those errors in addition to their own if you don't handle them. Callers who want to handle errors exhaustively with a switch will get compile errors if the error set changes and they fail to handle new errors.

There are no comments on this comment yet.