[cap-talk] small notes re: waterken
Raoul Duke
raould at gmail.com
Fri Mar 4 09:43:44 PST 2011
> I disagree that the correct way to do RAII in python would be to use a
> context manager in a with statement. It may be the only way to do a bit of
> RAII in the (broken) JVM and .NET implementation of python, but the base
> use of __del__ combined with variable scope (as in C++ RAII) to me is the
> correct way to do RAII without shifting undue knowledge to the user of an
> object in cPython.
word. this has bugged me about a lot of gc languages for a long time.
i asked about it wrt alice ml a while back and they were not
interested :-). the C# idiom sucks less than the java stuff, but it
still sucks vs. RAII in C++ (shudder, i said i liked something about
C++?!). clearly i'm not a vm/gc author, but as a programmer interested
in things being more correct than not, i've wanted a gc (i have to go
look at python now) that checks for zero ref-counts and frees those
then and there. if that sucks performance wise, at least do it for
those things that are tagged as being non-simple-memory-gcable
resources e.g. via the C# IDisposable interface or whatever.
sincerely.
More information about the cap-talk
mailing list