Comment

Comment by satvikpendem

What are the pros and cons of Zig vs Rust? I see Zig mentioned more and more here, especially with regards to threads about Bun, the largest / most popular project in Zig currently, but I'm not sure why I should use it over Rust. Zig seems like it still does not solve the problem of memory safety, in that it has safety issues that would be caught by a borrow checker or other such memory safety checker [0]. You can still use after free, for example:

    var hello = try allocator.dupe(u8, "hello world");
    allocator.free(hello);
    std.debug.print("{s}\n", .{hello}); 
[0] https://www.scattered-thoughts.net/writing/how-safe-is-zig/

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton