Fortran vs Python - Newbie Question

Carl Banks pavlovevidence at gmail.com
Mon Mar 26 17:45:46 CEST 2007


On Mar 26, 9:42 am, Jean-Paul Calderone <exar... at divmod.com> wrote:
> On 26 Mar 2007 06:20:32 -0700, "Noma... at gmail.com" <noma... at gmail.com> wrote:
>
> >OK...
> >I've been told that Both Fortran and Python are easy to read, and are
>
> Python is hugely easier to read.
>
> >quite useful in creating scientific apps for the number crunching, but
> >then Python is a tad slower than Fortran because of its a high level
>
> Fortran is massively faster than Python.
>
> >language nature, so what are the advantages of using Python for
> >creating number crunching apps over Fortran??
>
> You can get the speed of fortran in Python by using libraries like
> Numeric without losing the readability of Python.

This is true only for problems that can take advantage of scalability,
which is a large and important subset of all numerical problems, but
is still only a subset.

Some problems (e.g., simulation) require repeated sequential
evaluation of formulas.  For other problems (e.g., collision
detection) the operands change rapidly.  The scalability of numpy
doesn't help so much here.

(Anecdote: I once did a collision detection using Numeric.  It would
take slices out of the data set as it narrowed down the possible
collisions.  It actually worked pretty well.  But the slicing was
crazy and hard to follow.  I rewrote it in C and it was both faster
and more readable.)


Carl Banks




More information about the Python-list mailing list