Is Zig less secure than Rust, Go, and Java?
Zig claims to be simpler, leaving everything to programmers. Does this mean that programs written in Zig are more prone to problems? After all, no one is perfect.
Zig is like C, allowing you to control everything yourself.
Zig does not enforce bounds checking, but if you use the tools provided by Zig, it will check for common mistakes—Zig distinguishes between common, ambiguous, and ambiguous syntax and requires you to explicitly specify the handling method.
For example, Zig provides raw pointers [*]T (officially called ‘multiple pointers’). If you use these to access out of bounds, Zig won't intervene; however, if you use Zig's fat pointers []T (officially called ‘indexes’), out-of-bounds access will cause a panic.
Safety is a crucial aspect of heap memory management. Unfortunately (?), it is almost identical to C, fully exposed to you to use as you see fit. Zig does not have a garbage collector, so heap memory management is entirely different from Go or Java. Zig also differs from Rust's lifetime and ownership system. If you believe that languages with more rigid heap memory management are safer, then Zig is definitely not an option.