Python advocacy in scientific computation
val bykoski
val at vtek.com
Mon Mar 6 18:51:37 EST 2006
sturlamolden wrote:
> Robert Kern wrote:
>
>> 1. Write grant proposals.
>>
>> 2. Advise and teach students.
>
>
> Sorry I forgot the part about writing grant applications. As for
> teaching students, I have thankfully not been bothered with that too
> much.
>
>> Yes, and this is why you will keep saying, "My simulation is
>> running too slowly," and "My simulation is running out of memory."
>> All the vectorization you do won't make a quadratic algorithm run
>> in O(n log(n)) time. Knowing the right algorithm and the right data
>> structures to use will save you programming time and execution
>> time. Time is money, remember, and every hour you spend tweaking
>> Matlab code to get an extra 5% of speed is just so much grant money
>> down the drain.
>
>
> Yes, and that is why I use C (that is ISO C99, not ANSI C98) instead
> of Matlab for everything except trivial tasks. The design of Matlab's
> language is fundamentally flawed. I once wrote a tutorial on how to
> implement things like lists and trees in Matlab (using functional
> programming, e.g. using functions to represent list nodes), but it's
> just a toy. And as Matlab's run-time does reference counting insted
> of proper garbage collection, any datastructure more complex than
> arrays are sure to leak memory (I believe Python also suffered from
> this as some point). Matlab is not useful for anything except
> plotting data quickly. And as for the expensive license, I am not
> sure its worth it. I have been considering a move to Scilab for some
> time, but it too carries the burden of working with a flawed
> language.
>
A quick addition to Robert's very reasonable response to you. My point
is that to *trust* a simulation *results* (no matter how fast/slow/etc
you obtained it) you have to explore and manage the "physics" or
"biology" of your code. That's where Python's readability, flexibility,
and dynamism (including on-the-fly model building/testing/correction) as
well as model introspecting and exploration capabilities are of critical
importance and sometimes the indication to a missing link. It does not
hurt to remember that the original idea (by S.Ulam) of a computer was
the idea of an *experimentation environment* (including sampling). It
does not look like the Matlab's strongest point is the feedback-driven
experimentation. Or i'm missing smth about ISO C99?
Val Bykoski
More information about the Python-list
mailing list