News for hackers. Stuff that matters.
Re:Ask HN: Alternatives to Rust Programming Language by throwawaydsstr on Monday November 22, 2021 @01:56PM (#29310234)
What's the state of safety in zig? does it allow footguns like in C/C++ ? What about borrow checker(it makes program safe. isn't it?)? I would like to know advantages as well
Re:Ask HN: Alternatives to Rust Programming Language by dleslie on Friday November 26, 2021 @11:52AM (#29351830)
Zig does not have a borrow checker and allows footguns with relative ease. It's a C replacement, after all.

Sounds like you want Nim.

Re:Ask HN: Alternatives to Rust Programming Language by pcwalton on Monday November 22, 2021 @03:02PM (#29310975)
Zig is not memory safe, and is not meaningfully different from C and C++ in this way.
Re:Ask HN: Alternatives to Rust Programming Language by ncmncm on Monday November 22, 2021 @03:32PM (#29311276)
Anyway, not meaningfully different from C.
Re:Ask HN: Alternatives to Rust Programming Language by verdagon on Monday November 22, 2021 @05:47PM (#29312521)
I believe it has release-safe mode, which protects against most use-after-free. This is sufficient safety for most applications, IMO.

I only see it getting safer from here, with some advances on the horizon, such as memory tagging. The language has a lot of potential.

Re:Ask HN: Alternatives to Rust Programming Language by holonomically on Monday November 22, 2021 @01:58PM (#29310260)
The best answer I can provide is this document: https://ziglang.org/learn/overview/. It covers the main features of the language and how they compare to other languages like C, C++, and D. I personally think it has enough features like option types instead of null pointers, array bounds checking, generics, compile-time code execution, etc. for writing safe code but others might disagree.