Fortran vs Python - Newbie Question
mtobis at gmail.com
Wed Mar 28 18:22:16 CEST 2007
I feel obligated to fan the flames a bit by pointing to
http://www.fortranstatement.com/ a site which advocates discontinuing
development of Fortran and does a good job of summarizing the problems
with the contemporary development of that language.
I am not convinced that a new high performance language (Chapel,
Fortress, etc.) is necessary. Rather, I feel that FORTRAN 77 is a
mature tool, and that it, in combination with a powerful dynamic
language (Python being my choice) is entirely sufficient for any
foreseeable scientific computing.
Fortran 90 and successors (F9* in the following) provide a baroque and
elaborate effort to bolt modern computing methods over a finely honed
special purpose tool (F77) that manages large numerical arrays
spectacularly well. It is as if you decided to add a web search engine
(an elaborate, developing set of requirements) to grep (a finely honed
special purpose tool). It makes much more sense to add greplike
features to your websearch tool than to try to foist
"Grep95" (competing with the Google search engine) on everyone who
ever needs to find a misplaced text file.
F77 interfaces smoothly and neatly with Python. F9* continues to be
the single most difficult case for interoperability with any other
contemporary algorithmic language. Fortunately there is hope within
the new standard, where an "interoperability" flag will force F2003 to
deliver arrays that are exportable. In exchange for this balkiness,
F9* offers crude and verbose implementations of encapsulation and
I am sure Dr Beliavsky and some others are productive with F9*, but I
would strongly advocate against it for anyone in a position to make a
choice in the matter. Some people are competent with hand-powered
drills, but I wouldn't set up a furniture production line with them on
The performance and library advantages of Fortran are all available in
F77. Higher level abstractions can easily be wrapped around the low
level structures using Python and f2py. Making the combination
performance-efficient requires some skill, but making a pure Fortran
implementation efficient does no less so.
I don't think we should or can abandon the excellent infrastructure
provided by the Fortran of a generation ago. However, I am totally
unconvinced that there is a point to a backward compatible extension
to F77 that tries to support OOP and other abstractions unimaginable
in the early days of Fortran.
F77 and its numerical libraries are mature and complete. I think we
should treat it as a remarkable set of packages, and move on.
For any purposes I know of not involving an existing F9* legacy, I
believe that Python plus F77 is as good as or superior to F9* alone.
This includes the total time needed to learn the tools, (I think it is
easier to learn Python, F77 and f2py than to learn F9* alone to any
comparable skill level.) total time needed to develop the code, whole
system performance, testability and maintainability. Once Python gets
a first-class array type things will be even smoother as I understand
More information about the Python-list