|
| ▲ | smlavine an hour ago | parent | next [-] |
| I thought so too at first, coming from a language (Hare) where they are very easy and common, but the Diagnostics pattern isn't that bad once you expect it. Various examples: https://ziggit.dev/search?q=Diagnostics |
| |
| ▲ | srcreigh 3 minutes ago | parent [-] | | IIUC hare doesn’t have inferred error union return types, or errdefer, so payloads are just returning a tagged union. I don’t personally see how zig the language could make error payloads better than what’s in my post. Maybe they could add automatic inference for the return type? Idk how that would work. |
|
|
| ▲ | loeg 23 minutes ago | parent | prev [-] |
| Right. It's one thing to build the equivalent of Result into the language -- great. It's another to make it only support simple enum variants and not be extensible. |