7 ms·
Is reference counters really a smell? I thought it was the main way to write Rust when the borrow checker is too strict for something you want to do. Vec + gen
by verdagon 6y ago
Is reference counters really a smell? I thought it was the main way to write Rust when the borrow checker is too strict for something you want to do.
Vec + generational indices might be the other way, is that preferred over Rc?
- xiphias2 6y ago,,when the borrow checker is too strict for something you want to do'' Most of the times it isn't. Just as an example here's a random part of serde, the high quality serialization library in Rust: https://github.com/serde-rs/serde/blob/master/serde/src/private/de.rs https://github.com/serde-rs/serde/blob/master/serde/src/priv... The amount of extra automatic memory management is often a good indicator of not well thought out data structures (although of course they are not always needed).