News for hackers. Stuff that matters.
Re:Garbage Collection in Ruby 2.1 by AlexanderDhoore on Monday December 30, 2013 @05:20AM (#6983973)
It's interesting to compare this to how python does it (reference counting with generations): http://patshaughnessy.net/2013/10/30/generational-gc-in-pyth...

"At first glance, Ruby and Python seem to implement garbage collection very differently. Ruby uses John McCarthy’s original mark and sweep algorithm, while Python uses reference counting. But when we look more closely, we see that Python uses bits of the mark and sweep idea to handle cyclic references, and that both Ruby and Python use generational garbage collection in similar ways. Python uses three separate generations, while Ruby 2.1 uses two.

This similarity should not be a surprise. Both languages are using computer science research that was done decades ago – before either Ruby or Python were even invented. I find it fascinating that when you look “under the hood” at different programming languages, you often find the same fundamental ideas and algorithms are used by all of them. Modern programming languages owe a great deal to the ground breaking computer science research that John McCarthy and his contemporaries did back in the 1960s and 1970s."

Re:Garbage Collection in Ruby 2.1 by oleganza on Monday December 30, 2013 @05:39AM (#6984025)
I think Henry Baker had a paper on why generational and refcounting GCs are ultimately equivalent. Couldn't find it quickly, though, to give you a link.
Re:Garbage Collection in Ruby 2.1 by hencq on Monday December 30, 2013 @06:12AM (#6984106)
I think you might be thinking of this paper: A unified theory of garbage collection [1], which shows how most modern collectors are hybrids of GC and ref counting.

[1] http://atlas.cs.virginia.edu/~weimer/2008-415/reading/bacon-...

Re:Garbage Collection in Ruby 2.1 by brandonbloom on Monday December 30, 2013 @11:19AM (#6985174)
For the record: This is a very good paper. It's extremely easy to read, even for somebody who knows nothing about the background, and the scientific result is absolutely beautiful!
Re:Garbage Collection in Ruby 2.1 by kirubakaran on Monday December 30, 2013 @01:12PM (#6985892)
I just wanted to say thank you for this comment. I'm reading the paper because of it. Can you please point me to your other favorites that are good + accessible?
Re:Garbage Collection in Ruby 2.1 by brandonbloom on Monday December 30, 2013 @03:01PM (#6986539)
I wouldn't even know where to start :-)
Re:Garbage Collection in Ruby 2.1 by kirubakaran on Tuesday December 31, 2013 @12:21PM (#6991559)
Haha you aren't getting off that easy. Could you please tell me, say, 3 that come to your mind?
Re:Garbage Collection in Ruby 2.1 by oleganza on Monday December 30, 2013 @09:41AM (#6984764)
Oh, it was David Bacon. Thanks for finding this link.
Re:Garbage Collection in Ruby 2.1 by iagooar on Monday December 30, 2013 @05:50AM (#6984047)
Isn't it actually kind of sad, that such important researches don't get considered until 40 or 50 years later?
Re:Garbage Collection in Ruby 2.1 by riffraff on Monday December 30, 2013 @08:03AM (#6984419)
I don't think such research wasn't considered, it's been used constantly in many projects since.

The reason why some platforms have "silly" choices like stop the world M&S GC, or interpreters with AST walking is, likely, that optimization wasn't a goal in the original implementation and it's hard to retrofit it while keeping compatibility.