MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Re: PS. [Long, and possibly ranty ...]

  • To: mathgroup at
  • Subject: [mg29647] RE: [mg29608] Re: PS. [Long, and possibly ranty ...]
  • From: "Annetts, David (DEM, North Ryde)" <David.Annetts at>
  • Date: Fri, 29 Jun 2001 01:36:27 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Hi Orestis,

> That's the whole point! Mathematical computing is locked into 
> a loop, using
> FORTRAN just because you use FORTRAN! Not because it offers any actual
> advantage, or any other sane reason, but just because its use is so
> widespread.
> Someone should have taken the initiative and translated all 
> major FORTRAN
> libraries into C (or C++ or Mathematica) when the volume of 
> FORTRAN code was
> still manageable. Now it just keeps getting harder (and more 
> necessary).
> I tried once to translate a (small) FORTRAN routine into C. I 
> printed 5
> pages of code, glued it together and started tracing the 
> goto's. After 3
> hours of hopeless cutting and pasting, I gave up and wrote 
> the whole thing
> in Mathematica.

There are alternatives to this, but none are particularly palatable.  

The program f2c which comes with many Unix's can be used to transliterate
F77 code to C.  The C code is not particularly good, nor is it readable, but
it compiles nonethless.

The second option is to use a modern Fortran compiler instead of FORTRAN.
The differences between F90 (and F95) and F77 are significant.  A valid F77
code (with a few exceptions) is also a valid F90 (and F95) program.

> Senior members of the mathematical community still consider 
> FORTRAN a viable
> solution to mathematical computing. This has the following effects:
> a) Computer algebra systems are not adopted ...(the "why buy 
> Mathematica,
> when you have FORTAN?" argument)
> b) Young researchers are forced to implement new techniques 
> in FORTRAN, just
> so that their supervisors can understand their code...
> c) ...which reinforces the choke-hold FORTRAN has on mathematics.
> d) Young mathematicians are introduced to Scientific 
> Computation with the
> use of FORTRAN, which makes thinking in other paradigms (such as
> rules-programming or list-programming or even OOP) more difficult.
> So, "FORTRAN is dead, stop looting the corpse"!

The reason for this is that Fortran is not dead.  Even if it were economical
to translate Fortran into some (any) other language, Fortran has definate
advantages that other languages do not. 

I suggest that Fortran does not has a "choke-hold" on maths.  True, more
recent issues of TOMS (for what it's worth as some sort of standard of
mathematical software) have Fortran code, and regretably, some of it is F77,
but other algorithms are implemented in another system, and C/C++.  My understanding
from the Fortran community, is that any hold Fortran once had, is being
relinquished, simply because the language is not being taught in general.
When it is taught, it is by specialist "number crunchers" rather than by

Fortran is quite portable, with much less effort than C/C++.  Conditional
compilation directives are not portable in F90, mostly because they are not
needed.  Mathematica code, and symbolic algebra in general, is not particularly

Fortran is also quite readable, even in some of the more outdated codes.
Granted, it should be more readable (ie lower case), but this can be said
for any language.  For Mathematica, it has never been clear to me whether it is
better to use the Front End and get very clear documentation but lose ASCII
readability, or to use an ASCII editor to debug packages.  It has to be said
that readibility is mostly a responsability of the writer, and I have to
confess that my F90 code more resembles Mathematica than any Fortran dialect.  (I
also have to confess that I'm in the middle of an argument with my senior
supervisor because my F90 code does not look particularly like any Fortran
he's ever seen, even though it's valid and readable:)

However, mostly, the reason Fortran is not dead, is that it is fast and
efficient in its use of hardware.  What this means is that it is often a
very good choice for numerical computations such as those performed in
weather prediction, CFD, or my own, more prosaic field of electromagnetic
geophysics.  As much as I entertain thoughts of reimplementing
numerical-modelling code in Mathematica, and as pleased as I am with it, I can't
seriously entertain running my Finite-element models, which take over two
days on my beast here, in Mathematica.

Fundamentally, Fortran is not dead is because it is _useful_.  Not
everywhere (we write compilers & OS's in other languages now), and not in
every situation, but in particular fields.  

This is the reason that Mathematica is used where & when it is.  It is useful in
particular situations.  Another way of looking at this is to consider the
infrequent posts to the group regarding writing theses in Mathematica.  True, Mathematica is
a sophisticated text processing system, able to place text, equations and
plots on paper in a reasonably consistent manner, and this is possibly why
the group gets these queries.  It also has a spell secher (... checker;).
It is also true that people have written theses in Mathematica.  However, for most
people, Word (or WordPerfect) is an obvious choice, because that is what the
program is designed to do.  Consider that TeX is used.  Still.  Why?
Because in the right hands, it is a very powerful wordprocessing system.
Would you suggest the general populace use it, even though they may be
better off in the long run?

Horses for courses is all.  Some are not being flogged, though they're dead,
and if they just smell funny, consider standing upwind:)


  David Annetts, EM Modelling Analyst, CSIRO DEM, North Ryde
  Tel: (+612) 9490 5416		
  Fax: (+612) 9490 5467		  David.Annetts at
                 Include "usual_disclaimers"

  • Prev by Date: Re: convert an expression to an infinite series
  • Previous by thread: Charting question