top | item 47057772

(no title)

pmarreck | 11 days ago

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

discuss

order

bjourne|11 days ago

Zig is not faster than C.

flohofwoe|11 days ago

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.

lionkor|11 days ago

Would you say its always slower, or always faster?