Pb-jelly – A Protobuf code generation framework for Rust, developed at Dropbox
I work on the protobuf team at Google, and I'm a big fan of Rust, though I haven't written much actual Rust except a bunch of Project Euler solutions.<p>For protobuf in C++, we've been moving more and more in the direction of using arenas for memory allocation. When you parse a protobuf, it creates a tree of objects that are usually all deleted at the same time. Freeing an arena is much, much cheaper than traversing the tree of objects and calling free() on each one.<p>My dream has been that Rust protobuf could support arenas as well as C++, but use Rust's type system to make it all provably correct at compile time (in C++ the lifetime management is inherently manual and unsafe).  For absolute top performance, arenas will always beat trees of unique pointers (which I think corresponds to Rust's Box<> type).<p>I don't know Rust's type/lifetime system well enough to know if this is possible.  I was looking recently at arenas in Rust and I noticed that Rust's version of placement new seems to be stalled:<p>"Unfortunately the path forward for placement new in Rust does not look good right now, so I've reverted this crate to work more like a memory heap where stuff can be put, but not constructed in place."<p><a href="https://docs.rs/light_arena/1.0.1/light_arena/" rel="nofollow">https://docs.rs/light_arena/1.0.1/light_arena/</a><p>Does anyone know more about this?