because Zig is simply a better C, often faster (normally at least as fast), but with way more safety guarantees or at least things preventing the vast majority of traditional C footguns from happening
With default build settings it actually might be, because Zig's release mode builds with the equivalent of `-march=native` by default ;)
(disclaimer: not sure if that's actually still the case, last I checked in detail was probably 2 years ago).
Also Zig always builds the entire project as a single compilation unit, which allows more optimization options because the compiler sees all function bodies. The closest equivalent in the C world is LTO, but this is usually also not enabled by default.
bjourne|11 days ago
flohofwoe|11 days ago
(disclaimer: not sure if that's actually still the case, last I checked in detail was probably 2 years ago).
Also Zig always builds the entire project as a single compilation unit, which allows more optimization options because the compiler sees all function bodies. The closest equivalent in the C world is LTO, but this is usually also not enabled by default.
lionkor|11 days ago