Re: Lock-free reference counting

Juha Nieminen wrote:
Jon Harrop wrote:
There is one reason to choose reference counting for a new language:
It's a million times simpler to implement than an efficient GC engine
(ie. one which would beat an efficient reference counting system).

Sure GC can be more efficient than reference counting, but to get
there you need a *lot* of work.


You are not writing consistently. Earlier in this thread you basically
said that reference counting is dead. Now you are agreeing that it *is*
a rational choice when weighted by the amount of work necessary to
implement it?

The rational choice is to build upon an existing VM like the JVM or CLR in
order to reuse its performant concurrent GC implementation. New languages
like F#, Scala and Clojure are doing this today.

Even if you are implementing your own VM from scratch, you would reuse an
existing tried-and-tested GC. The Mono project is doing that today, using
Boehm's GC.

If I were to build a new VM today, I would probably choose a Cheney
semi-space collector over reference counting because it is as easy as
reference counting but more accurate (it collects cycles).

Dr Jon D Harrop, Flying Frog Consultancy Ltd.