Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As far as I can tell, Zig's niche compared to Rust is to specifically cater to certain design patterns that C and C++ support, but other languages don't. E.g., anything that uses pointer manipulation for business logic.


I think it's more about low level control of allocation.

You can do "pointer manipulation" in safe Rust if you need to - anything that uses arena indices is basically that, e.g. petgraph.

The language wasn't really designed for it though so it isn't exactly integrated into the syntax.

But controlling allocation precisely is quite difficult in "normal" Rust.

Tbh I don't think it is actually that far away from Rust. It's aimed more at low level stuff, whereas Rust aims to do every level. It is more "trust me bro" than Rust's "no I'm going to check" safety. And comptime is pretty different to Rust's approach (arguably better).

But apart from that they seem to have very similar goals.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: