
Doctor Fortran in “The Future of Fortran” - nkurz
https://software.intel.com/en-us/blogs/2015/03/27/doctor-fortran-in-the-future-of-fortran
======
QuantumRoar
Fortran is still going strong. At a High-Performance Computing seminar I
attended a few years ago, the speaker said that around 50% of high performance
computing applications are written in Fortran (you know, these shiny little
programs that can hog a million CPUs for a few hours or weeks or months). The
other half being mostly C and C++.

However, programming in Fortran is uncomfortable. Just like programming in C.
The advantage of Fortran over C in High-Performance Computing is that it's
less uncomfortable to write maths and things with arrays in Fortran.

If you ever need to handle enormous arrays without breaking a sweat or solve
systems of equations with hundreds of thousands or millions of variables, you
can give Fortran a try. The syntax has come a long way since FORTRAN 77.

Fortran's strength has always been speed. In the early days most Fortran
programs would run faster than C programs. The trick is to intentionally leave
out features that bloat the language such that all there's left in the
language can easily be optimized by the compiler. Only after the C99 standard
(I think), C caught up to Fortran in most applications due to stricter
aliasing rules.

~~~
yiyus
The main reason Fortran is so extensively used today is not because of the
merits of its new features but the incredible amount of (intrinsically
complicated, but even more because it is highly optimized) legacy code. I
guess that most of that 50% running in HPC is FORTRAN77 written many, many
years ago, with a bit of Fortran90/95 and only an insignificant fraction of
Fortran 20xx.

~~~
cbd1984
Assuming the FORTRAN77 was optimized for hardware circa a period when
FORTRAN77 wasn't considered an ancient language, is it still optimized on
modern hardware? Because it seems the vast increase in the relative importance
of cache alone, not to mention the great changes in cache sizes, would make
some optimizations fairly pessimal these days. (For example, loop unrolling
blowing out I-cache.)

~~~
colechristensen
Languages aren't optimized, compilers are, and fortran compilers commercial
and free are released regularly.

~~~
cbd1984
> Languages aren't optimized, compilers are

Actually, specific pieces of code get optimized, and compilers that can "undo"
optimizations put in to the source code by hand are so rare I daresay they
don't exist.

~~~
brorfred
The intel compiler is considered to generate runtimes that runs about twice as
fast as runtimes from gfortran. Haven't seen any recent tests of CLANG/LLVM
yet. The statement that compilers, not languages, are optimized generally
holds true for Fortran.

~~~
gnufx
"Considered" maybe, but not measured in practice. Of course you need
equivalent optimizations to generate similar code -- Intel even defaults to
incorrect optimizations. GCC is also substantially more reliable in my
experience watching users who insist on using Intel on HPC systems without
actually measuring anything.

Of course compilers are relevant, but Fortran has long presented optimization
possibilities that aren't typically available in other languages, like not
passing by reference.

------
punch_card
unpossible.

    
    
           DO 100 I=1,10
      100  SUM = SUM + X(I)
    

No longer supported ? hWhat ? And don't get me started about COMMON and
EQUIVALENCE.

To be blunt, FORTRAN 77 was probably the most practical language ever devised.
What is this monster ?

I predict more code written in FORTRAN 77 is being used today that all of the
code written in later dialects. And this will be the same for the next 20
years.

~~~
AlexeyBrin
_Note that none of these will actually be removed from any compiler you are
likely to use, but their use will be flagged if you ask for standards
checking._

