Python advocacy in scientific computation

Magnus Lycka lycka at carmen.se
Mon Mar 6 05:02:16 EST 2006


Dennis Lee Bieber wrote:
> 	I did look at Ruby once... It looked to me like the worst aspects of
> PERL grafted onto the worst parts of old Python.

Don't forget that there are portions of Smalltalk syntax
(blocks) added in as well. I guess it could be seen as Perl-NG.
Both the name 'Ruby' and the Ruby syntax seems to suggest that
Matz had the idea to "flirt" a bit with the Perl programmers,
and considering how Perl seems to be in decline today, that
might have been clever from a user-base point of view. Whether
it was really good for the language is another issue. I still
think it's a bit prettier than Perl though.

> 	For CPU-bound number-crunching, perhaps... For I/O-bound jobs, the
> GIL is(should be) released when ever a thread is blocked waiting for I/O
> to complete.

I think CPU-bound number-crunching was the big deal in this case.
Somehow, I doubt that the OP uses Matlab for I/O-bound jobs. At
least if writing threaded applications becomes less error prone
in competing languages, this might well be the weak point of Python
in the future. I hope to see some clever solution to this from the
Python developers.

It seems the Python attitude to performance has largely been:
Let Python take care of development speed, and let Moore's law
and the hardware manufacturers take care of execution speed. As
it seems now, increases in processing speed the coming years
will largely be through parallell thread. If Python can't utilize
that well, we have a real problem.

>>5. I don't like numpy's array slicing. Array operations should be a
>>part of the language, as in Matlab, Fortran 90, Ada 95, D, Octave.

Python is not primarily a mathematics language. It's not a text
processing language either, so no regexp support directly in the
syntax. That might make it less ideal as a Matlab substitute, or
as a sed or awk substitute, but on the other hand, it's useful for
so many other things...

> 	Everything in Python is a reference to an object. I think the
> question you want is more on the lines of: Can I change an object that
> has been passed? 

The key lies in understanding that "a=b" means "bind the local name
(unless declared global) "a" to the object the name "b" refers to.
It never means "copy the content of b into the location of a".



More information about the Python-list mailing list