3 ms·
There was some consideration for a formal library based rust GC back in 2018 such that one could write GC<CyclicDataType> and get the benefits of a GC such as
by lumost 6y ago
There was some consideration for a formal library based rust GC back in 2018 such that one could write GC<CyclicDataType> and get the benefits of a GC such as
- Not leaking memory
- Not invoking unsafe
- Not angering the rust compiler
None of those efforts stabilized to my knowledge, and the libraries developed for this task all have experimental/research tags associated to them.
For better or worse all the guides for using rust strongly encourage avoidance of primitive cyclic structures such as doubly linked lists, graphs, and other structures in favor of statically allocated fixed size variants. Like golang's preference for map/list as the only primitive structures, this is a constraint that one can get used to for most problems. But it doesn't feel great that as a language there are basic algorithms and datastructures that can't be idiomatically coded in the language.
- steveklabnik 6y agoThere’s a new GC library released the other day https://blog.typingtheory.com/shredder-garbage-collection-as-a-library-for-rust/ https://blog.typingtheory.com/shredder-garbage-collection-as... Still extremely new, of course, but has promise!
- deleted 6y ago[deleted]