Re:I stopped everything and started writing C again
by codedokode on Wednesday March 12, 2025 @05:34PM
(#43347899)
I saw mentions of Zig here often, so I decided to look at the docs to see what features it has. I had to scroll through all the docs only to find myself disappointed by the fact that Zig doesn't help with memory management in any way and advices to use comments and careful coding instead. And what adds to the disappointment is that its plus/minus operators do not catch overflow. If I wanted undefined behaviour, I could just use C/C++ as no language can compete with them in this regard.
[ Parent
| on HN ]
Re:I stopped everything and started writing C again
by somethingor on Thursday March 13, 2025 @12:22PM
(#43354816)
> plus/minus operators do not catch overflow
They do (in Debug and ReleaseSafe modes)
Re:I stopped everything and started writing C again
by codedokode on Thursday March 13, 2025 @08:13PM
(#43358497)
Why not have the same behaviour everywhere? Because they are adapting the language to legacy CPUs not capable of detecting an overflow? It doesn't take many transistors to implement.