Matklad recently published an excellent and thought provoking piece at Zig And Rust
As someone who knows no Zig and has no idea of the full powers of comptime, the feature that stuck out most to me is passing allocators as an argument.
I am curious if there are rust stdlib replacement libraries that do this (especially for the embedded space). I envision, for example, Vec.push would take an extra argument (allocator) and return an Optino<()> indicating success / fail.
What is the current status of explicit-allocator Rust libs ?
There is to some extend. E.g. Vec is now generic over the allocator and has an unstable (nightly-only) API to use a different one than the default global one: Vec in std::vec - Rust
It also has a push_within_capacity to allow you to handle reallocation when you need it.