|
|
|
|
|
by ziml77
408 days ago
|
|
Manual memory management is not a reason Zig couldn't have supported sum types for error returns. You don't need an allocator involved at all to return a discriminated union like Rust uses. I actually find Zig quite a pleasant language other than my gripe with not handling more complex errors as cleanly. |
|
Using out parameters for context, or diagnostic pattern like std does is not bad at all imo.
The only nice thing error payloads give you is better error messages in case of uncaught errors.