Python 2.0

Gordon McMillan gmcm at hypernet.com
Wed Jun 2 10:08:18 EDT 1999


Martijn Faassen wrote:

> Yukihiro Matsumoto wrote:
> 
> > Some languages use both.  Ref counting for usual basis, real GC for
> > full clean up.  How about adding real GC to Python 2.0, co-working
> > with ref counting?
> 
> This sounds like an interesting idea; I believe I saw references to
> garbage collecting schemes that help clean up circular references
> caused by referencing counting. I forget where, though. :)

That would probably be Ken Thompson discussing Inferno. William  
Tanksley mentioned this recently. You can read the interview at
 http://computer.org/computer/thompson.htm

> * In the complex case, garbage collecting is nice as it cleans up
> circular references. There are unwanted side-effects of its
> unpredictability, though; a possible leaking of resources (files
> which aren't closed), and some difficulties interfacing with C.

Unpredictability has been well-thrashed recently. Two posters have 
mentioned that GC doesn't *have* to be unpredictable, but I've never 
seen one that wasn't. I can attest to GC not necessarily imposing 
difficulties in writing extensions. Writing Java native methods in 
MS's RNI is very straightforward. No pointers to pointers. They use 
generational GC. In the context of a native call, nothing will be 
moved. You can "fix" an object before returning to Java, and 
otherwise control GC. Not as slick as using CXX, but easier than 
Python's C API.

- Gordon




More information about the Python-list mailing list