Rust has a static “garbage collector”
> I don’t generally find writing Rust to be significantly harder than using a GC’d language. I’ve been trying to figure out why that is.<p>That's quite surprising! Here's some examples of where things would be easier to write if Rust had a GC:<p>1. Any sort of lock free algorithm. This is a big one - hazard pointers and the like are much harder than letting the GC clean up.<p>2. Data structures which may contain "back" pointers (e.g. parent pointers in a tree).<p>3. Data structures which may be cyclic. For example the classic LRU cache is best implemented with a cyclic linked list which is hard to express in Rust.<p>4. Any sort of refactoring that may adjust ownership. E.g. going from T to Rc<T>. GC requires fewer choices so these refactorings are easier.<p>Surely this pain is real, even if Rustaceans think it's worth tolerating?<p>In fairness precious resource cleanup (file descriptors, etc) is easier without a GC.