Get the latest tech news

Error payloads in Zig


I do error payloads in Zig by making a union(enum)-based Diagnostics type for each function. These types have special methods which remove code bloat at call sites.

None

Get the Android app

Or read this on Hacker News

Read more on:

Photo of zig

zig

Photo of Error payloads

Error payloads

Related news:

News photo

Lessons from Zig

News photo

Data Processing Benchmark Featuring Rust, Go, Swift, Zig, Julia etc.

News photo

Memory layout in Zig with formulas