When and why would you use Zig instead of Rust and vice versa?

Zig mostly aims to be a C replacement, whereas Rust aims to displace C++.

However, lately Zig’s author started investing in ergonomics and compatibility more – his article on making the Zig compiler integrate with C compilers and using Zig’s unified CLI commands and switches to interact with those legacy C compilers is excellent – so I am not sure what’s his future direction.

I don’t want to fanboy for Rust but it has a very dedicated and hardcore community and it’s IMO only a matter of time before it eats part of C’s lunch (and thus Zig’s),

Not saying Zig is doomed – I liked its demos a lot and the author is extremely talented.

But between Rust being better and better every month and reaching for more and more areas – parts of the embedded / strongly constrained environments included – I am not sure if Zig won’t remain a niche language whose main selling point would be “I am a better C for microcontrollers”.

Could be wrong though – I am simply sharing what I’ve gathered all over the net and through my own experience. Take it with a bag of salt.

5 Likes