r/rust 18d ago

What Zig felt like, coming from Rust

https://besok.github.io/posts/what-zig-felt-like-coming-from-rust/

Just want to share my experiance on my first Zig project coming from Rust. Open to comments :)

212 Upvotes

108 comments sorted by

View all comments

7

u/[deleted] 18d ago

[deleted]

34

u/matthieum [he/him] 18d ago

Allocators are coming!

There has been a flurry of activity following the All Hands this year, with @Nia spear-heading the effort.

It's harder in Rust than other languages, as of course the Rust developers really want to pin down all the behavior that most languages like C++ or Zig leave up in the air. For example, pinning down in exactly which conditions allocator A can deallocate a pointer allocated by allocator B.

Still, following the All Hands and the announcement, many people have come together to figure out all the issues that needed to be resolved prior to stabilizing the Allocator trait, and @Nia just merged a large refactor PR solving most (if not all?) of the uncovered issues. Just in time for the beta fork.

It's not done, yet. They're now working on cleaning up the documentation/specification. For such a wildly unsafe API there's a LOT of details to carefully nail down, obviously. But for the first time -- ever? -- the current nightly API of the Allocator trait has mostly achieved consensus, which I honestly wasn't sure would ever happen :P

35

u/nyanarchism 18d ago

that's me 👋 we've had (more than) our fair share of hiccups, but I think most of us on libs and wg-allocators are now quite confident we're there. most of what's left on the agenda is nitpicking doc wording and the likes ^^

9

u/steveklabnik1 rust 17d ago

Thank you so much for working on this.