Re:Does the Bronze Garbage Collector Make Rust Easier to Use?
by KptMarchewa on Thursday December 23, 2021 @07:07AM
(#29661045)
Can you use lifetimes for most objects, and use GC where it's "hard"? Like, canonical example with double linked lists.
[ Parent
| on HN ]
Re:Does the Bronze Garbage Collector Make Rust Easier to Use?
by rtoway on Thursday December 23, 2021 @11:01AM
(#29663098)
You can do this in Rust today, with the standard library's reference counter
Re:Does the Bronze Garbage Collector Make Rust Easier to Use?
by klodolph on Thursday December 23, 2021 @01:36PM
(#29664896)
Also, one of the easiest ways to leak memory in Rust. My understanding is that substructural typing systems are just not quite powerful enough to represent the semantics of double-linked lists, but I don't understand the math myself.
Obviously it won't leak memory if you do it correctly, but Rust will happily let you leak memory in an Rc<T>.
Re:Does the Bronze Garbage Collector Make Rust Easier to Use?
by ThomasWinwood on Friday December 24, 2021 @08:58PM
(#29679609)
If you really do want to leak memory, Rc<T> is overcomplicated - just call `Box::leak` and throw away the output.