logoalt Hacker News

afavouryesterday at 7:23 PM2 repliesview on HN

> There is a lot of quality stuff made with C/C++

There’s a lot of leaky crap written in those languages too. One of the core promises of Rust is that the compiler will catch memory issues other languages won’t experience until runtime. If Zig doesn’t offer something similar it’ll make Rust very compelling.


Replies

kllrnohjyesterday at 11:09 PM

Zig is a love letter to C. It does not do much of anything to address memory management. Doesn't even have any concept of ownership like C++ does (ergo, no equivalent of unique_ptr / shared_ptr). All you get over C is the addition of defer, and even that isn't really that different if you're using GCC or Clang and thus have __attribute__((cleanup)).

show 2 replies
dnauticsyesterday at 7:40 PM

rust does not promise leak safety.

show 1 reply