3 ms·
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
by tomrod 2y ago
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.
- pitaj 2y agoZig is strictly better than C. It has a better interop story than Rust. The biggest downside right now is that it isn't stable.
- flohofwoe 2y agoIMHO 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.
- dns_snek 2y agoMost 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.
- pjmlp 2y agoI 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.
- rami3l 2y agoI'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.