logoalt Hacker News

scuff3dtoday at 1:41 AM2 repliesview on HN

Continues to be a point of annoyance that Zig doesn't properly support payloads in errors.


Replies

smlavinetoday at 1:47 AM

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

show 1 reply
loegtoday at 2:34 AM

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.