Comments by "" (@pierreollivier1) on "Zig is FASTER and SAFER than Rust | Prime Reacts" video.
-
@neniugrava I think going forward Zig makes a lot more sense than Rust for low level programming. The main reason in my opinion is that I don't think that the Rust Borrow checker, and all the mechanics of lifetime are necessary for 95% of the problems it tries to solve. On one hand I get it with Rust at least there is next to no doubt, when it compiles it means 99% of the time it does what you wanted it to do, and it's safe. But from my experience, most of the problems and bugs in C/C++ code base don't come from memory management, in fact I would argue that the problem of memory management is really just a symptoms of the general lack of type safety in both languages. C++ has improved a lot, but it also carries so much bloat and unnecessary complexity. Zig is IMHO in the perfect middle, it's very strongly typed compared to C/C++ and unlike Rust Zig allow you to do all of the error prone / hacky stuff very easily in comparaison, but to do so in Zig means you'll need to be very verbose and that friction was made to both make explicit to you and others that what you are doing is not normal. If you combine this with the fact that Macro and templates are replaced with Comptime and compiler builtins, This makes writing complex code trivial and much more importantly maintaining that code is a breeze, idk if anyone has ever tried to build complex templates in C++ but it's very painful especially the debugging is hell.
1