D
Daniel Dittmar
Michael said:<button nature="hot">
Reference counting *is* a form of garbage collection.
</button>
Saying "Ref. counting sucks, let's use GC instead" is a statement near
as dammit to meaningless.
This statement is not meaningless because most programmers will correctly
identify GC in this context as something like mark-and-sweep, generation
scavenging etc.
see also: DOS sucks, let's use an operating system instead.
current scheme's biggest drawback is its memory overhead, followed by
the cache-trashing tendencies of decrefs.
plus it doesn't support independent threads as all reference counting would
have to be protected, leading to poor performance.
But a lot of Python code depends on reference counting or more exactly it
depends on the timely call of the destructor. So even if a much better GC is
added to Python, reference counting would perhaps be kept for backwards
compatibility (see Python's biggest compromises)
Daniel