News for hackers. Stuff that matters.
Re:Zig: What to Expect from Release Month by tomrod on Friday January 17, 2025 @09:43AM (#42737994)
Cool to see!

I'm interested in learning a lower level language a bit better. I've spent some time in Rust and C (not enough to be proficient) -- is Zig a good candidate? It seems to have a lot of interest, I'm curious about objective views on its long term progress and forecast.

Re:Zig: What to Expect from Release Month by dns_snek on Friday January 17, 2025 @10:17AM (#42738399)
Most of my work is in higher level languages and I never liked C due to its many quirks and footguns which made me think that I just didn't enjoy low level programming.

I learned that I was wrong when I spent some time hacking around lower level programming with Zig and I thoroughly enjoyed it. It just clicks for me in ways that C and C++ never did.

Re:Zig: What to Expect from Release Month by pjmlp on Friday January 17, 2025 @02:20PM (#42742195)
I was fortunate to have learnt low level programming via various BASIC, and Turbo Pascal, alongside Z80 and 8086 Assembly, that C was never special to me, other than being more cross-platform due to the way it came to be.

Luckily around the same time I also got hold of Turbo C++ 1.0, and Borland's Pascal / C++ tag team is what kept me interested.

Re:Zig: What to Expect from Release Month by flohofwoe on Friday January 17, 2025 @09:58AM (#42738158)
IMHO the main difference where you need to "think different" compared to lower level languages like C or higher level languages like C++ and Rust is memory management. The entire Zig stdlib expects allocators to be provided by the caller and there's a handful of specialized allocators in the stdlib to pick from. This opens up a lot of flexibility for explicit memory management, but to take real advantage of this new freedom requires some experimentation and unlearning when coming from most other languages.
Re:Zig: What to Expect from Release Month by pitaj on Friday January 17, 2025 @09:49AM (#42738051)
Zig is strictly better than C. It has a better interop story than Rust. The biggest downside right now is that it isn't stable.
Re:Zig: What to Expect from Release Month by rami3l on Friday January 17, 2025 @09:44PM (#42745345)
I've been playing around with Zig as a potential C alternative in my stack, and I think that it's pretty good at least for toy/learning projects actually. I especially like the way `comptime` gives me superpowers.

Before Rust and Zig, I thought I disliked systems programming, while as it turned out, I mostly just disliked C.

However, when it comes to actively maintaining a serious project you do need to take extra care, since using a pre-v1 language does require a lot more efforts, since even in a post-v1 language you need to handle lib updates and such...

Also, even though I believe I'm no longer afraid of manual memory management, explicit allocators, etc. for writing regular userland applications, I still think Zig can be too low-level for certain problem domains from time to time (the same thing for C, and I believe Zig is there specifically to target C programmers), so it's really about finding out which tools would be a great fit for you in which scenarios.