News for hackers. Stuff that matters.
Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by gizmo on Sunday November 06, 2011 @12:36PM (#3203250)
> What language systems in existence are using a true incremental or concurrent garbage collector? I know of three: Java, Objective C 2.0 (which just shipped with OS X Leopard), and the .net runtime. Not Haskell. Not Erlang. Not Objective Caml. [...], not Smalltalk not Ruby.

Oh, why could that possibly be. Hmm...

- Java: Sun

- Objective C: Apple

- .Net: Microsoft

Big companies with the manpower and determination to make improvements to their platforms. All the other languages have either grown out of one-man prototypes or academic projects. Building a good garbage collector is hard. It's difficult because you can't keep track of much data while you're allocating, you can't walk the graph of allocated objects because different threads are modifying the graph while you're working on it. When you then add a constraint that you can never stop the world for more than 5ms at the time it becomes a Difficult Problem.

Languages like Ruby, Python, Lisp and Scheme don't have good generational garbage collectors because they don't have the manpower to tackle Difficult Problems. (See for instance the global interpreter lock in Python. It's been 10 years now?)

To tackle a Difficult Problem you need (a) a few smart people and (b) get them to work on the problem for many consecutive hours for many consecutive days. Volunteers just can't afford to spend 50+ hours a week for half a year on a problem. A hundred people can chip in weekends and evenings for a year and make no substantial progress at all.

This is completely different from the hypothetical "sufficiently smart compiler" that is supposed to sense the intent of the programmer and optimize accordingly. A sufficiently smart compiler cannot compensate for bad algorithm design, so the performance differences will always be in the margins. The state-of-the-art in terms of garbage collection is decades ahead of what we see in Python, Ruby, Haskell, Scheme and so forth. The GC problem is simple: spread the computational overhead of garbage collection evenly so that the application doesn't stutter. Simple engineering problem with a concrete and clear goal. Just difficult to implement.

Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by DanielRibeiro on Sunday November 06, 2011 @05:27PM (#3204092)
Languages like Ruby, Python, Lisp and Scheme don't have good generational garbage collectors because they don't have the manpower to tackle Difficult Problems.

It seems that you confused language with implementation. For example: want a Ruby without GIL and with great garbage collector? Use JRuby (and this assumes we are comparing to the official one: YARV). One language, different implementations.

Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by gizmo on Sunday November 06, 2011 @06:18PM (#3204232)
JRuby just piggybacks on Java. That doesn't invalidate my point, as far as I can tell.
Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by DanielRibeiro on Monday November 07, 2011 @12:55AM (#3205193)
JRuby uses the JVM. Java is the language. Same point: language != implementation. Not always, but nowadays we have many mature vms, so it is more common.
Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by bunderbunder on Monday November 07, 2011 @10:55AM (#3206702)
Seems like languages which can't or don't want to target JVM or CLR might do well to at least take a cue from Sun and Microsoft, and pool resources. On both those platforms, there are scads of languages all sharing the same GC.

Which leads me to wonder - WTF ever happened to Parrot? I know the project is still alive, but why doesn't anyone seem to be using it?

Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by lucian1900 on Tuesday November 15, 2011 @03:05PM (#3239912)
Sadly, Parrot sucks. It doesn't have a stable bytecode, its assembly is buggy and too high-level, it only recently got a generational (but still m&s stop-the-world) GC and has no useful object system.

I've tried implementing Python3 on it for GSoC and failed.

Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by lucian1900 on Tuesday November 15, 2011 @03:07PM (#3239919)
PyPy is growing a nice concurrent GC (and a solution to the GIL). I believe Rubinius also has a work-in-progress concurrent GC.
Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by abecedarius on Sunday November 06, 2011 @02:10PM (#3203481)
In "Objective Caml. [...]" what you snipped out started with an "Oops, forget what I just said about Objective Caml."
Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by gizmo on Sunday November 06, 2011 @06:15PM (#3204223)
OCaml's garbage collector doesn't deal with concurrency!
Re:Why Garbage Collection Paranoia is Still (sometimes) Just... by abecedarius on Monday November 07, 2011 @03:18PM (#3207946)
You quoted "incremental or concurrent".