Re: [Python-Dev] apparent ruminations on mutable immutables (was:PEP 351, the freeze protocol)

2005-11-02 Thread Michael Chermside
Josiah Carlson writes:
 If you make such a suggestion, I would offer that you create a new PEP,
 because this discussion has gone beyond PEP 351, and has wandered into
 the realm of What other kinds of objects would be interesting to have
 in a Python-like system?

Noam Raphael replies:
 That is a good suggestion, and I have already started to write one. It
 takes me a long time, but I hope I will manage.

My thanks to both of you... following this conversation has been an
educational experience. Just for the record, I wanted to chime in with
my own opinion formed after following the full interchange.

I think Noam's propsal is very interesting. I like the idea of allowing
both frozen (ie, immutable) and mutable treatments for the same
object. I think that C++'s version of this concept (the const modifier)
has, on balance, been only a very limited success. I find myself convinced
by Noam's claims that many common use patterns either (1) only use mutables,
or (2) only use immutables, or (3) only use immutable copies temporarily
and avoid mutating while doing so. Any such use patterns (particularly
use (3)) would benefit from the presence of an efficient method for
creating an immutable copy of a mutable object which avoids the copy where
possible.

However... it seems to me that what is being described here is not Python.
Python is a wonderful language, but it has certain characteristics, like
extremely dynamic behavior and close integration with underlying system
methods (C in CPython, Java in Jython, etc) that seem to me to make this
particular feature a poor fit. That's OK... not all languages need to be
Python!

I would encourage you (Noam) to go ahead and explore this idea of yours.
You might wind up building a new language from scratch (in which case I
strongly encourage you to borrow _syntax_ from Python -- its syntax is
more usable than that of any other language I know of). Or perhaps you
will prefer to take CPython and make minor modifications. This kind of
experimentation is allowed (open source) and even encouraged... consider
Christian Tismer's Stackless -- a widely admired variant of CPython which
is unlikely to ever become part of the core, but is nevertheless an
important part of the vivrant Python community. You might even be
interested in starting, instead, with PyPy -- an large project which has
as its main goal producing an implementation of Python which is easy
to modify so as to support just this kind of experimentation.

You are also welcome to submit a PEP for modifying Python (presumably
CPython, Jython, Iron Python, and all other implementations). However,
I think such a PEP would be rejected. Building your own thing that
works well with Python would NOT be rejected. The idea is interesting,
and it _may_ be sound; only an actual implementation could prove this
either way.

-- Michael Chermside

___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] apparent ruminations on mutable immutables (was:PEP 351, the freeze protocol)

2005-11-02 Thread Noam Raphael
Thank you for your encouraging words!

I am currently working on a PEP. I am sure that writing it is a good
idea, and that it would help with explaining this idea both to others
and to myself.

What I already wrote makes me think that it can be accomplished with
no really large changes to the language - only six built-in types are
affected, and there is no reason why existing code, both in C and in
Python, would stop working.

I hope others would be interested in the idea too, when I finish
writing the PEP draft, so it would be discussed. Trying the idea with
PyPy is a really nice idea - it seems that it would be much simpler to
implement, and I'm sure that learning PyPy would be interesting.

Thanks again, and I would really like to hear your comments when I
post the PEP draft,
Noam
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] apparent ruminations on mutable immutables (was:PEP 351, the freeze protocol)

2005-11-01 Thread Delaney, Timothy (Tim)
Noam,

There's a simple solution to all this - write a competing PEP. One of
the two competing PEPs may be accepted.

FWIW, I'm +1 on PEP 351 in general, and -1 on what you've proposed.

PEP 351 is simple to explain, simple to implement and leaves things
under the control of the developer. I think there are still some issues
to be resolved, but the basic premise is exactly what I would want of a
freeze protocol.

Tim Delaney
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com