What does HackerNews think of wg-allocators?
Home of the Allocators working group: Paving a path for a standard set of allocator traits to be used in collections!
https://doc.rust-lang.org/std/alloc/index.html#the-global_al...
My vague understanding is that there's a working group https://github.com/rust-lang/wg-allocators
The further I get from working on Rust day to day, the less I know about these things, so that's all I've got for you.
https://rust-lang.github.io/rfcs/1398-kinds-of-allocators.ht...
Right now you could also go no_std (you still get the core library, which does not contain any allocating data structures) and use custom containers with a passed in allocator.
Zig is definitely a cool language, and it will be interesting if they can come up with good solutions to memory management!
But sentences like these in the documentation [2] would make me prefer Rust for most low level domains (for now):
> It is the Zig programmer's responsibility to ensure that a pointer is not accessed when the memory pointed to is no longer available. Note that a slice is a form of pointer, in that it references other memory. ...
> ... the documentation for the function should explain who "owns" the pointer
[1] https://github.com/rust-lang/wg-allocators
[2] https://ziglang.org/documentation/master/#toc-Lifetime-and-O...
1. Rust the language knows nothing about allocation. If you care about this behavior, it mostly limits the code of others' that you can use, but you can always write your own versions of things that respect fallible allocations.
2. Rust's standard library assumes memory is infallible. This is partially because it's a good default, and partially because our allocator API was not ready yet.
3. We've been working on the allocator API.
4. We have a rough plan for parameterizing data structures over allocators.
5. If this topic is of interest to you, https://github.com/rust-lang/wg-allocators is where to get involved.