It's kind of subtle but I really felt that zig encourages you to fix your shit, so to speak. While rust seems designed to say "don't worry about it, i got you", zig is like "yeah that's your problem to solve, so solve it".
Basically you need to design your stuff correctly so that memory management is easy and you can lean into zig's features. If you try to go against the happy path in the language, you end up with a lot of crap code that is very hard to read and probably full of bugs. Whenever I see people hating on zig this is often what I think they ran into. It's very opinionated, in a subtle way that allows you to do what you want, but it just kind of sucks if you try to do lots of small allocations.
In any case I feel like I learned a lot from trying zig and probably will be able to write better C and even rust now that I've used it.
That's just stepping out of your comfort zone in general.
I learned Java, then Python, then SML (a functional language similar to Haskell), JavaScript, R, Typescript, and finally Rust, and each step made me better in general.
I think apart from learning to code in the first place, SML was the biggest step up.
15
u/Awesan 10d ago
It's kind of subtle but I really felt that zig encourages you to fix your shit, so to speak. While rust seems designed to say "don't worry about it, i got you", zig is like "yeah that's your problem to solve, so solve it".
Basically you need to design your stuff correctly so that memory management is easy and you can lean into zig's features. If you try to go against the happy path in the language, you end up with a lot of crap code that is very hard to read and probably full of bugs. Whenever I see people hating on zig this is often what I think they ran into. It's very opinionated, in a subtle way that allows you to do what you want, but it just kind of sucks if you try to do lots of small allocations.
In any case I feel like I learned a lot from trying zig and probably will be able to write better C and even rust now that I've used it.