Hacker News new | ask | show | jobs
by ojeda 1755 days ago
> Zig and Rust are safe languages

Zig is a nice improvement over C, but it is not safe.

There is work in progress (https://github.com/ziglang/zig/issues/2301), but from what I can tell, key details are still to be decided, including the classes of errors that will be covered, whether they will require runtime tracking, etc.

In my opinion, Zig should look into becoming UB-less -- listing undefined behavior instances like the C standard does or enabling safety only in some build modes is not enough.

1 comments

Exactly! Zig is an improvement over C in many areas, but it's fundamentally still _not_ a memory safe language. It's comparable to a modern C/C++ project setup with valgrind and allocator checks by default. The comptime is nice, but C++17 and upwards have dramatically improved the "comp time" compiling in C++.