[Techtalk] Fortran? (was Re: US Participants)
mcafee at transmeta.com
Mon Oct 8 12:39:07 EST 2001
Kai MacTane <kmactane at GothPunk.com> wrote:
>Just out of curiosity, is Fortran really being used much anymore? I thought
>it was essentially dead.
According to O'Reilly's "High Performance Computing", one reason why
Fortran is still widely used because it is more optimizable than more
modern languages. In broad terms, the simpler the language, the more
assumptions an optimizer can make, and so the more highly optimized
is the resulting machine code. Features like C's pointers can stymie
optimization because the object the pointer refers to can't be known
until run time.
Consider the following Fortran code fragment:
DO I = 1,100
A(I) = A(I) * B(I)
A smart optimizer can realize that the hundred different multiplications
are all independent of each other, and if the program is compiled on a
machine with a hundred processors, the compiler can dispatch one
multiplication operation to each processor. On the other hand, if you're
programming in C and using more sophisticated data structures like linked
lists, trees, etc. to store your data, fewer assumptions can be made by the
optimizer, and the code is going to run slower.
More information about the Techtalk