Better HN
topnewbestaskshowjobs
Log inSign up

RyanVail

2 karma · joined Feb 12, 2026 (9mo ago) · 2 submissions

Submissions

comment 2mo ago · link · parent

Zig doesn't have attributes, but you could just create a thin wrapper struct over an inner type and use setter functions that throw errors on invalid values. Personally I prefer this over attributes because it forces you to handle possible error states from the callers of the setters, instead of relying on you remembering to call `validate` on your types.

comment 7mo ago · link · parent

Actually with Opus you can compress a three minute song to 1.44 MB without it sounding absolutely terrible. I definitely don't have the best ear for music, but when I compared a three minute song I compressed with Opus at ~67kbit/s with the original, I couldn't tell the difference.