When will Java go mainstream like Python?

sjdevnull at yahoo.com sjdevnull at yahoo.com
Thu Feb 25 08:03:30 CET 2010


On Feb 24, 8:05 pm, Lawrence D'Oliveiro <l... at geek-
central.gen.new_zealand> wrote:
> In message <op.u8nfpex8y5e8ok at laptopwanja>, Wanja Gayk wrote:
>
> > Reference counting is about the worst technique for garbage collection.
>
> It avoids the need for garbage collection.

That's like saying that driving a VW Beetle avoids the need for an
automobile.  Reference counting is a form of garbage collection (like
mark-sweep, copy-collect, and others), not a way of avoiding it.

You're right that ref counting in many implementations is more
deterministic than other common forms of garbage collection; IMO,
Python would be well-served by making the ref-counting semantics it
currently has a guaranteed part of the language spec--or at least
guaranteeing that when a function returns, any otherwise unreferenced
locals are immediately collected.

I could be convinced otherwise, but I _think_ that that change would
offer an alternative to all of the interesting cases of where the
"with" statement is "useful".



More information about the Python-list mailing list