logoalt Hacker News

Garbage collection is contrarian

61 pointsby aapoalaslast Friday at 9:15 PM15 commentsview on HN

Comments

kannanvijayantoday at 12:29 PM

Writing a GC in rust without just dropping the whole business into unsafe is really annoying.

Jason Orendorff has an implementation of a GC in rust called "cell-gc" that seemed like only one I've seen so far that seemed to "get" how to marry rust to the requirements of a GC implementation: https://github.com/jorendorff/cell-gc

Still has a lot of unsafe code and macro helpers, but it's laid out well and documented pretty well. Not sure if you've run across it yet.

shevy-javatoday at 10:18 AM

This reminds me of the old Monty Python sketch:

https://www.youtube.com/watch?v=uLlv_aZjHXc (Argument Clinic)

show 1 reply
erutoday at 4:52 AM

Compare also 'A Unified Theory of Garbage Collection' https://web.eecs.umich.edu/~weimerw/2008-415/reading/bacon-g...

antonvstoday at 9:49 AM

Just intuitively, this seems to be using a feature designed to guarantee safety in a way that doesn’t guarantee safety, which raises questions about what the point is.

show 1 reply
anArbitraryOnetoday at 11:11 AM

I clicked on this hoping is was about physical garbage collection

show 2 replies
_3u10today at 10:01 AM

Just use unsafe then you have all of the good points of rust, like being able to say you wrote it in rust with none of the downsides, like having to write safe code in rust, or that code being slow.

illuminator83today at 12:10 PM

I'm hoping for a future in which humankind looks back with embarrassment at this silly period in its history in which people used to think a leaky and bad abstractions like garbage collection was ever a good approach to deal with resource life-times.

show 3 replies