Hacker News new | ask | show | jobs
by fleventynine 961 days ago
There's a lot to like about Zig, especially related to metaprogramming. Unfortunately, bulletproof memory safety is table stakes for a modern language. Without a garbage collector or borrow checker, Zig is DOA for any use case that involves untrusted data.

Maybe there's a few niches (single player games?) that don't need memory safety...

1 comments

You can always use a garbage collecting allocator with Zig, if you're that paranoid anout it.
For that better use D, Nim, Swift, C#, Go, designed from the ground up with one in mind, and whole ecosystem counts on it, instead of having coloured libraries.
By convention, all Zig libraries have functions that take an allocator as input from the user. Your application can use libgc[1] and pass the allocator to any library function you use, and not worry about deallocating afterwards.

[0]: https://github.com/linusg/zig-libgc

You missed the part of ecosystem designed with a GC in mind.
Does an ecosystem designed with custom allocators (including gc) in mind not count for anything?