News for hackers. Stuff that matters.
Re:Zig; what I think after months of using it by pcwalton on Wednesday February 05, 2025 @01:24AM (#42944623)
> It provides quite a few compile time checks and primitives to catch memory leaks or prevent them altogether.

From what I've seen, clang has all of these and more for C++. If your metric is "tooling to help you catch UB", C++ is significantly superior to Zig.

Re:Zig; what I think after months of using it by chrisco255 on Wednesday February 05, 2025 @01:35AM (#42944711)
Zig has a C and C++ compiler built into it and works seamlessly with it. Several C/C++ projects use Zig as a build tool. Zig makes different trade-offs with C++ from a language design standpoint. C++ has a lot more footguns to create UB in the first place.
Re:Zig; what I think after months of using it by pcwalton on Wednesday February 05, 2025 @01:37AM (#42944725)
> C++ has a lot more footguns to create UB in the first place.

I'd actually give the edge to C++ over Zig, because of smart pointers (not that I'm implying smart pointers are anywhere near sufficient).

Re:Zig; what I think after months of using it by brabel on Wednesday February 05, 2025 @01:58AM (#42944881)
WTH they were talking about Rust and Zig, they did not even mention C++ and you come with "if your metrics is blah then C++ is superior, checkmate!", completely ignoring C++ is a monster of complexity while Zig is basically simple as C.
Re:Zig; what I think after months of using it by Ygg2 on Wednesday February 05, 2025 @03:21AM (#42945591)
If you present an argument that you like X in a thing so you picked B, and A exist that's more X than B, it means your argument is partially (you like X and Z) or totally (you like Y) wrong.

In this context of, if you are using Zig for its safety via tooling, there is a much more mature candidate C++.

Re:Zig; what I think after months of using it by brabel on Wednesday February 05, 2025 @12:44PM (#42952241)
That's exactly what I was criticizing: you just make the unfounded assumption that "argument that you like X" is the only thing that matters, and the debate is not only about X in the context of languages A and B. Introducing C to the debate is stupid, as then the obvious answer is just "but C has Y which is horrile" and so on.