DEV Community

Discussion on: No More Tears, No More Knots: Arena-Allocated Trees in Rust

Collapse
 
deciduously profile image
Ben Lovy

Totally - I've gone the Rc<RefCell<T>> route for other projects, and it does get you there but it always feels hacky and brittle. In C++, you really just use the Rc-equivalent shared_ptr when you actually want multiple ownership over some data, not to skirt around language semantics when its convenient for you - this strategy is kinda antithetical to what draws me to Rust in the first place! There are definitely legitimate uses of runtime interior mutability but I don't feel this is one of them.