Post

Partial Operator Precedence

Zig’s development branch now requires parentheses for combinations of operators with easily confused precedence, while retaining familiar arithmetic precedence. The change rejects expressions such as x orelse y == z until the programmer makes the intended grouping explicit.

The project says 353 lines in its million-plus-line codebase needed changes. zig fmt --upgrade can add parentheses preserving the old interpretation, though the author recommends reviewing the result for pre-existing mistakes. HN readers compare the design with WGSL and discuss whether Rust tooling could offer similar checks.