Hacker News new | past | comments | ask | show | jobs | submit login

To be clear, cyclic references are just as much an issue in GCed languages. In Python I had to use weakref lib to ensure cyclically referenced objects are still GCed. Rust is the same in that aspect, you use the Rc builtin type and create a weakref for one of them.



No, GCs can handle cyclic references. You don't need weak references merely in order to ensure that a cyclic structure is eventually freed once it's become inaccessible. That's not to say that there might not sometimes be good reasons for using weak references in a GCed language, however.


You were being overpessimistic: Python's GC handles cyclic references perfectly well.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: