3 ms·
Had never heard of zig. Does it also provide memory safety without a GC like Rust?
by didibus 9y ago
Had never heard of zig. Does it also provide memory safety without a GC like Rust?
- masklinn 9y ago"Unsafe Zig" encompasses all of Zig, much like e.g. C.
- audunw 9y agoNo, not to the same extent. It attempts to make C-style memory management as safe as possible, and also make it easy to use different memory allocators, but does not attempt advanced techniques like borrow checkers. There's also a pretty good metaprogramming system, so it may be possible to implement some smart memory-management libraries. Zig is about simplicity. It's a C (and partly C++) replacement, not a Rust replacement. Think of it this way: I could easily imagine a TCC-like, dirt-simple, super-fast compiler for Zig. I'm not sure we'll ever see the same for Rust. That's nothing against Rust, just saying they have very different goals.