On Wed, 17 Jun 2009 23:29:48 +1200, Lawrence D'Oliveiro wrote: > In message <7x7hzbv14a....@ruckus.brouhaha.com>, wrote: > >> Lawrence D'Oliveiro <l...@geek-central.gen.new_zealand> writes: >> >>> > Reference counting is an implementation detail used by CPython but >>> > not [implementations built on runtimes designed for >>> > corporate-herd-oriented languages, like] IronPython or Jython. >>> >>> I rest my case. >> >> You're really being pretty ignorant. I don't know of any serious Lisp >> system that uses reference counting, both for performance reasons and >> to make sure cyclic structures are reclaimed properly. > > Both of which, oddly enough, more modern dynamic languages like Python > manage perfectly well.
*Python* doesn't have a ref counter. That's an implementation detail of *CPython*. There is nothing in the specifications for the language Python which requires a ref counter. CPython's ref counter is incapable of dealing with cyclic structures, and so it has a second garbage collector specifically for that purpose. The only reason Python manages perfectly well is by NOT relying on a ref counter: some implementations don't have one at all, and the one which does, uses a second gc. Additionally, while I'm a fan of the simplicity of CPython's ref counter, one serious side effect of it is that it requires the GIL, which essentially means CPython is crippled on multi-core CPUs compared to non- ref counting implementations. -- Steven -- http://mail.python.org/mailman/listinfo/python-list