five
Newbie

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.

kale
Newbie
1#

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.

canup
Newbie
2#

Zig's goal is not ‘security.’ As long as it does not create additional security issues due to language limitations as C++ does when complexity increases, that is sufficient. The complexity of the problem itself should be handled by the programmers themselves.

Login
{{error.username}}
{{error.password}}
or
Register
{{error.username}}
{{error.nickname}}
{{error.email}}
{{error.password}}
{{error.repassword}}
Forget the password
{{error.email}}
{{error.code}}
Reply:{{reply.touser}}
Edit
Allow cookies on this browser?

All cookies currently used by FreeTalkHub are strictly necessary. Our cookies are employed for login authentication purposes and utilise Google's one-click login functionality, serving no other purpose.