News for hackers. Stuff that matters.
Re:A Review of the Zig Programming Language (Using Advent of... by anonymoushn on Monday December 27, 2021 @10:25AM (#29703207)
> One nugget of knowledge I’ve worked out though - Zig is not a replacement for C. It is another replacement for C++.

While comptime is a potential source of complexity, I sort of think C++ developers won't accept a replacement that has no RAII or automatic invocation of destructors.

Re:A Review of the Zig Programming Language (Using Advent of... by tomcam on Monday December 27, 2021 @10:34AM (#29703281)
Meh. Not trying to start a language war but I was grateful to switch from C++to Go when the price was to lose generics and a few other things in exchange for the language’s simplicity and clarity.
Re:A Review of the Zig Programming Language (Using Advent of... by dnautics on Monday December 27, 2021 @10:53AM (#29703475)
I think there are so many corners where people are using C++ that making generalizations about them is likely to fail.
Re:A Review of the Zig Programming Language (Using Advent of... by tomcam on Monday December 27, 2021 @12:20PM (#29704406)
That’s why I referred exclusively to my preferences. It is obviously the more comprehensive and versatile language.
Re:A Review of the Zig Programming Language (Using Advent of... by dnautics on Monday December 27, 2021 @12:59PM (#29704851)
I was mostly referring to gp's broad statements, comment was in support of your experience, which is good feedback to hear.
Re:A Review of the Zig Programming Language (Using Advent of... by Bekwnn on Monday December 27, 2021 @03:33PM (#29706478)
There's an open issue to add some kind of function annotation+errors for functions which require you to call a cleanup function.

The discussion has had a lot of back and forth and they haven't really settled on a desirable solution yet, but it's something they're hoping to add.

https://github.com/ziglang/zig/issues/782

I work in games with C++ and we already do so much manual management and initialization+teardown functions that lack of RAII isn't a deal-breaker. Though I'd definitely prefer it if there was something either well-enforced or automatic.

Re:A Review of the Zig Programming Language (Using Advent of... by anonymoushn on Tuesday December 28, 2021 @05:18AM (#29712214)
This sounds good. While I don't have much preference about "being explicit" vs having automatically-invoked dtors, it will be nice to be nudged when I actually forget to clean up.