Python 2.0

Hisao Suzuki suzuki611 at okisoft.co.jp
Wed Jun 2 23:56:03 EDT 1999


In article <3755714F.294CCB8D at pop.vet.uu.nl>,
Martijn Faassen <faassen at pop.vet.uu.nl> wrote:
| Aahz Maruch wrote:
[snip]
| > I'm curious: does GC provide any advantages other than its ability to
| > deal with circular references?
| 
| I think certain forms of GC can use less memory; I don't think all forms
| of GC need extra data for all objects, like you need to store the ref
| counter in.

Yes.  And it is also often said that GC can be faster than
reference counting.  But this does not solely determine the
whole speed of every interpreter of every language.

For example, mostly Perl runs faster than Ruby (which is Perl's
successor invented by Mr. Matz --- {'June':'Pearl', 'July':'Ruby'}),
whereas Perl uses reference counting and Ruby uses some
sophisticated GC.

As for the issue of circular references, in my opinion, the
future Python should use non-compacting GC at the end of the
last thread and destroy the remained objects by invoking their
__del__ methods --- it is THE time to destroy all the objects
remained, so this is conceptually clean (thus very Pythonic :-),
though it is the way of memory management used in the present
Perl in fact...

--===-----========------------- Sana esprimo naskas sanan ideon.
SUZUKI Hisao            suzuki611 at okisoft.co.jp, suzuki at acm.org.




More information about the Python-list mailing list