50 years of Fortran at CERN (2007)
cerncourier.com
cerncourier.com
To me, programming during that time, it seemed like FORTRAN's evolution stalled at a critical period between FORTRAN IV and FORTRAN 77. I'd been exposed to LISP, PL/1, SOBOL, and APL in my university programs and it was frustrating to use FORTRAN IV for non-numerical projects. The last time I did so was around 1974 when I wrote a LR parser generator in FORTRAN IV. The lack of mechanisms for handling structured data made it a messy job.
It was at that point that I came across the source for the Wirth's first Pascal compiler that ran on the computation center's CDC 6400. I learned Pascal by studying that code and I never wanted to go back to FORTRAN (or PL/1).
A few years later the greatly improved FORTRAN 77 became available, but it was too late. C and Pascal were real and gaining ground and Algol 68, CLU, Alphard, Scheme, the Red and Blue languages, and ADA had captured the imagination of the language designers.
CLU even more than Alphard is an example of an academic experiment in language design that had a profound influence on the future of real programming languages.
Exceptions -- C++ exception handling comes from the ideas found in CLU.
Object oriented programming -- The name CLU comes from cluster because Barbra Liskov recognized the importance of compound data structures (objects, but she called them clusters) that supported an explicitly defined interface of functions (methods). These ideas were inspired by Simula (an older simulation language that had support for defining the real-world things, objects, being simulated).
Immutable vs mutability -- Strings were immutable, as were other elementary types.
Iterators and yield -- First introduced in CLU are now common in modern languages.
Call semantics -- like lisp, data is passed by sharing a reference to the data, in contrast to the way FORTRAN or Algol passed parameters. Java and many other languages now use these call semantics, not just Lisp of Scheme.
Multiple assignment -- operations (methods) could return tuples that were destructured at the point of call into multiple values. Now common in modern languages.
Variable sized arrays -- as I recall, the runtime was intended to handle the autosizing of vectors. I'd never seen anything like this before 1974 (except for LISP's lists).
All these important ideas and more in a language no one programmed in.
Other languages were pushing in new directions too. The Algol68 Revised Report came out while I was in grad school. Wow, the language spec was so interesting that SIGPLAN made it a special edition of their monthly journal. Every concept was completely generalized: arrays could have multiple dimensions and any number of these could be left out while indexing an array value resulting in a multi-dimensional slice. I've still never seen anything like this in a modern language (is it supported by R or Mathematica? I can't remember.) Again it wasn't the implementation of Algol68 that was important (the language as specified was too hard to implement) it was the ideas it suggested to future language designers--in fact, Niklaus Wirth quit the Algol68 design committee with the idea that Algol ought to go in a simpler direction, which led to Pascal.
The object-oriented features (inheritance and type-bound procedures, for example) were added only in Fortran 2003. Also, since the writing of the article, there has been another revision, Fortran 2008, adding support for parallelism (coarrays).
Modern Programming Languages: Fortran90/95/2003/2008
https://www.tacc.utexas.edu/documents/13601/162125/fortran_c...
[0] http://portalparts.acm.org/1280000/1279941/fm/frontmatter.pd...
For example, "Fortran is the language of high-performance technical computing -- even if this is an increasingly smaller segment of today's computing activities."
I grow weary of this form of sentence construction. Saying "X is the language of Y" smacks of marketing, not something that I want to see in a journal such as the International Journal of High-Energy Physics. I don't mind if a writer claims something the best language for high-performance technical computing, but they should at least give some comparison with alternatives and empirical support.
Update: I see this was written in 2007.
The author wasn't making an opinion claim- just facts. In particular, when an english speaker says "X is the Y of Z" they aren't saying it's better, they're saying its more prevalent.
> (pronounced stressing “the”) used to indicate that someone or something is the best known or most important of that name or type. "he was the hot young piano prospect in jazz"
I would tend to agree that "best known" is relatively objective (in theory -- but who really believes in an objective definition of what 'everyone' knows?); however, "most important" clearly tends towards subjectivity, as it implies value judgments into what is important and why.
You can write performant code in C/C++, and many do, but Fortran is still the easiest to do so in.
Let's not get too carried away, what is an example of Fortran making speed easier than C++?
Plus, array's are a first class feature in Fortran. "But Eigen!" you retort. Sure, except this library I want to use uses MTL4, this other library that I need uses uBlas, and this other one uses MKL. Ouch, ouch, ouch.
Pretty much if you can write Matlab you can write very highly performant Fortran without doing anything too special. Dealing with incompatible libraries, templates, and all the other stuff that C++ subjects you to is not 'easy'.
These same compiler engineers don't want to actually write any Fortran -- but I assure you, as an astronomer, I really prefer it that my Astronomy colleagues write Fortran instead of C/C++. It ends up being better code.
To me the main reason for its use seemed to be 50 years of technical debt. Ancient, badly-written functions written long ago that have been thoroughly tested but no-one can remember why they work; ancient professors who refuse to learn another language or validate code written in another language. And so the technical debt feedback cycle continues.
JavaScript is incomparably slower than Fortran. Also, Fortran has been fast since day 0.
Edit: I've just found out that "restrict" has been added in C99. Which means that even in the 90s there was no good support for parallel/vectorized code in the C standard.
edit: Variable Length Arrays (VLAs) were also not available until C99 for C, while they were part of Fortran since 1990.
There are certain aspects to FORTRAN that naturally lend it to being fast but you still need to write it in a way that can be optimised, which isn't always the most obvious way. You need to know the language and compiler well to wrote fast code, just as you would with any other language.
It's also quick because the language is designed to enable compilers to generate fast code. In indexed (for-style) loops, for example, the loop body cannot change the loop variable, aiding unrolling and/or vectorization.
And these days, I'm not quite sure whether they weren't better off…
In fact, I am certain that all the desktop apps I've worked with would be much simpler to maintain and distribute were they written in Tcl/Tk.
Now, there's plenty of lightweight, portable, GUI toolkits to use that I can just write a wrapper or code-generator for. Tcl/TK is less necessary than before. Still among simplest, though.
It is hard to write numerical code that consistently works correctly in the face of rounding errors and the like, and it is hard to know if you are getting the right answers in many cases. It makes sense to use the old code (which performs well) rather than write something new and take the risk of screwing it up in some subtle way.
It is not hard at all to access FORTRAN data structures from C, Python, Java or whatever your favorite "modern" language is.
I have no idea what the software looks like now.
So the claim of "use" is really what the astronmer sees in their programmer- not in the measure of instructions executed.
Python/Matlab/IDL are important because it is easier to quickly write correct code than in C++/Fortran.
Had I written the paper (I'm a scientist, I work with astro data sets at times, and manage Python wrappers for Fortran and C++ libraries) I would have calculated this based on instructions executed, not lines of user-facing code.
After all, if the code the astro people called was Pure Python, they wouldn't use python, as it would be too slow.
#!/usr/bin/env python
from subprocess import Popen
Popen("/usr/bin/some-fortran-binary")
print("Once again python saves the day.")...for some values of "desirable"
I remember trying to figure out how to get an array of strings from Excel to Fortran. The farthest I got was getting the combined strings into the Fortran and getting stuck trying to figure out how to manipulate arrays in FORTRAN 90 I think it was.