logoalt Hacker News

kibwen • yesterday at 4:04 PM • 1 reply • view on HN

People have been able to do this in Rust for longer than Zig has existed. What this new development brings is a standardized interface to streamline interoperability, not any new language capability. The bumpalo crate has been the standard bearer here for nearly a decade now, currently counting 778 million downloads on crates.io.


Replies

lenkite • yesterday at 5:53 PM

Without standardized interfaces, custom allocators have limiteduse. bumpalo could only be used seamlessly with its own custom types (like bumpalo::collections::Vec or bumpalo::boxed::Box.

bumpalo::collections::Vec<'bump, T> is a completely distinct type from std::vec::Vec<T>. You cannot pass an arena-allocated Vec or String to third-party libraries that expect standard library types without copying or converting them to slices first

➕ show 1 reply