4 ms·
The objection is to the term "garbage collection", not the term "region". "Garbage collection" implies dynamic lifetime determination. Rust's ownership system
by kibwen 5y ago
The objection is to the term "garbage collection", not the term "region".
"Garbage collection" implies dynamic lifetime determination.
Rust's ownership system is static lifetime determination.
For those instances where dynamic lifetime determination is necessary, Rust provides types like Rc (which can be considered a very rudimentary garbage collector).
- miguelraz 5y agoOh, I see. Yes, that's a useful distinction then. Will edit. Thanks!
- moonchild 5y ago> "Garbage collection" implies dynamic lifetime determination. It does not. It refers to automatic memory reclamation. Generally, memory reclamation policies (whether automatic or manual) are closely tied to lifetimes—a sound program does not attempt to reuse objects which are still alive—but that is incidental in this context. In rust, programs generate garbage, do not explicitly clean it up or free it, and it is reused for new allocations; that is garbage collection. Reference counting, far from rudimentary, is a highly effective means of garbage collection which works quite well for certain types of programming languages and programs. (Notable examples include switch/objc, nim, and apl.) It has fallen out of favour in recent times because popular languages in industry and academia encourage execution patterns that perform much better with tracing garbage collectors, but that is not in itself a mark against reference counters.