News for hackers. Stuff that matters.
Re:Zig 0.5.0 Release Notes by richardwhiuk on Monday September 30, 2019 @01:55PM (#21117935)
> Zig both signed and unsigned integers have undefined behavior on overflow, contrasted to only signed integers in C

make a feature unwanted in C, worse. nice.

Re:Zig 0.5.0 Release Notes by AnIdiotOnTheNet on Monday September 30, 2019 @02:13PM (#21118109)
debug and safe modes in zig disallow overflows entirely unless you specifically use the wrapping operator to clearly specify your intent. These checks are removed in speed-optimized builds.

In other words, the compiler will enforce that `a + b` does not overflow through all your testing and wherever you explicitly say such checks are required, but turns them into nops for you when you desire speed. You can let the compiler know that you explicitly want wrapping overflow (and not some undefined kind) using the wrapping operator `a +% b`.

Re:Zig 0.5.0 Release Notes by stateoff on Monday September 30, 2019 @02:13PM (#21118114)