[Python-ideas] Message passing syntax for objects

Stephen J. Turnbull stephen at xemacs.org
Thu Mar 21 14:37:42 CET 2013

Mark Janssen writes:
 > On Mon, Mar 18, 2013 at 7:14 PM, Haoyi Li <haoyi.sg at gmail.com> wrote:

 > > I think this is a significant point: small things (lists, tuples,
 > > primitives) are kept as structs and the data inside them is
 > > manipulated directly,
 > Yes, and here is where something significant I think will happen.
 > Complicated data structures just simply don't get re-used.  Python
 > allows lists within lists within lists, but any program that uses
 > that outside of n x n matrices won't ever get re-used ever.

I don't see the distinction you're aiming at.  PyPI, for example, is
full of extremely complicated data structures that get reused.  Some
of them get reused fairly frequently, though not as often as simple
lists and tuples.

 > Because there is no unified data model.

That I can agree with, as an absolute.<wink/>

 > > Having a simple thing (like a list or a tuple) with encapsulation
 > > and sending messages to it is as silly [...]
 > Ah, but you see I'm envisioning a data ecosystem (to borrow a
 > phrase) for the Internet.  A peer-2-peer model for sharing data.
 > So sending messages isn't so silly.

Sure.  Smalltalk proved that.  But it's also not a universal
improvement over the algebraic model of objects and operators, or
function and method calling, and so on.  It can already be emulated in
Python (including the "ignoring messages you don't understand" aspect,
AFAIK) by using properties to turn what look like attribute references
into method calls (or with a rather uglier syntax, dict references).

I can see the advantage to you for your very specialized (at present,
anyway) research project of a fairly radical change to Python syntax,
but I don't see an advantage to the vast majority of Python users?

More information about the Python-ideas mailing list