[Python-Dev] Re: [Fwd: Discussion: Introducing new operators formatrix computation]

Huaiyu Zhu huaiyu_zhu@yahoo.com
Thu, 13 Jul 2000 18:30:02 -0700 (PDT)


Paul Prescod wrote:

> I think that the idea is that you could install new syntaxes in the same
> way you install new modules...of course only after careful
> consideration!!!
 
This is much more than I has bargained for.  Separting syntax with sematics
is really the way to go.

> I'm not entirely against your proposal but you've got to expect major
> pushback on such large-scale syntax and semantic changes.

Well, I was only asking for some additional operators, which wouldn't affect
a single line of existing code.  Everyone says no you can't get it, that's
too much, but on the other hand you should get a parser to change the syntax
anyway you want.

So if I ask more I shall get the bit I wanted.  When would this wonderful
new parser be available so that I can change the syntax beyond recognition?
:-)

> > Look it this way.  Text processing do have their special syntaxes.  
> 
> Okay, but probably 90% of Python programmers do text processing at some
> point. Not so for matrix calculation. You believe that the Python world
> would grow greatly if we did matrices natively. I don't know if I
> believe that.

I don't believe python should be bond to this heritage as much as perl does.
Maybe those who do matrix have not joined yet.  To justify support by the
number of existing users sounds like a self-fulfilling prophacy.

Think about how many users would do text precessing if they have to write
regular expressions as layers of composite functions?  How many would use
arithmetic if they have to write add(mul(1,2),div(2.,3.))?

Now compare what's written in matlab/octave

	(X'*X)\(X'*y)

with what's written in python

	 matrixmultiply(inverse(matrixmultiply(transpose(X), X)), 
	                (matrixmultiply(transpose(X), y[:,NewAxis])))

Now look at the total number of users of matlab/octave, and ask: Is python
really so inferior that most of them wouldn't switch to python?

To change this status does not even need native support of matrix.  The only
thing required is that there be enough binary operators to be overridden by
applications - any application that needs additional binary operators.


> > PS. I suppose I am allowed to post to python-dev without invitation, but
> >	not subscribing to it?  I find this rather strange.
> 
> Yes, it is rather strange.

But I can see its use now.  I have to get your reply from web and cut and
paste in order to reply again. :-(

Huaiyu