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

The two languages have completely different design philosophies and a completely different feel leading to a completely different experience. I would say they're more different from each other than Java is different from Python. Some low-level developers will be drawn to Rust more while others will be drawn to Zig more.


Oh, that's something I know, of course.

I just wonder what are the advantages of using a language that is not memory-safe and it's not even stable yet...

Edit: If there's any technical reason. Of course, being a hobby project, the author is free to pick whatever he feels is most ergonomic/he likes the most.


I am not a 10x systems programmer but I have used both for MCU projects.

An expert Rust programer probably wouldn't have the same friction points I experienced.

Two of the main advantages of the Rust borrow checker is preventing use after free and iterator invalidation.

Zig's deferred free helps with the first, and hardware FIFOS, doorbells etc often caused me to have a non significant amount of unsafe code.

For me, the array safety in Zig removes most of the C foot guns, and the Rust projects decision to error on the constrained side of the static analysis dichotomy was getting in the way.

It isn't even a case of one being 'better' for me, the tradeoffs just made Zig better for this use case for me.


The idea that memory safety is a binary choice between what Rust provides and anything less than that has absolutely no grounding in either empirical or theoretical results. For example, it is true that there are good empirical reports that some high percentage (~70%) of security issues in C programs are due to memory safety, but most of those are due to lack of spatial safety, and Zig offers the same level of spatial memory safety as Rust. But in short, you get a language that's far safer than C and far simpler than Rust, which appeals to some just as Rust appeals to some (and frankly, both appeal to far fewer people than what's necessary to achieve even a medium level of success).




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

Search: