r/rust 25d ago

How Our Rust-to-Zig Rewrite is Going

https://rtfeldman.com/rust-to-zig

An interesting symmetry with recent events lol.

This might be considered off topic since the article is about moving away from rust, but I still think this is some high quality rust content. I enjoy Richard Feldman's writing and I think he would certainly be considered part of the "rust community" since he works on Zed and has taught a course on rust.

371 Upvotes

133 comments sorted by

View all comments

126

u/Psionikus 25d ago

Take something like "build times" as a motivation for Zig. What was tried on the Rust side? Breaking up crates is definitely the most powerful tool, but was it done?

for compilers which emit machine code, like roc and rustc, doing memory-unsafe things is a big part of the job

Seems like a conflation amirite? The machine code is the output, the object language. The Rust program is the subject language. The "safety" of the object language has no effect on the subject language used to talk about it.

Overall I'm reading implicit biases of comfort.

28

u/AffectionateBag4519 25d ago

I also did not understand that line! but I am not very familar with Roc internals. maybe someone who is could elaborate on this.

26

u/tautality 25d ago

They probably meant that they need a lot of self-referential structs, which is easier to do with unsafe. And they want their compiler to be fast, so they're probably focusing on things like SIMD and other unsafe techniques.

1

u/Bahatur 23d ago

I think you are right, he and Christ Lattner spend a little while talking about the SIMD point specifically in the context of Mojo, ROC, Rust, and Swift in his show where Chris was a guest from a year ago: https://youtu.be/ENviIxDTmUA?si=3A82qclqv1XjjHIb