Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can you elaborate more?



There it says "errors are values" so now that contradicts what OP said.


I said I wasn't speaking for Zig specifically, just on general principle that errors are not really values. Many languages reify errors as values to avoid having different semantics for errors, but errors probably should have their own semantics. Zig seems to take a middle ground here, where errors are a special type of value but that still sort of has its own semantics.


> I said I wasn't speaking for Zig specifically

Lol, you are right. My brain just skipped that part somehow.


I was generally responding to the whole thread and pointing to how Zig sees errors. Enums are a type of value, yes, but they're typically dealt with differently than other data types.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: