Top
Best
New

Posted by rbanffy 7 hours ago

Celebrating 70 Years of Fortran(fortran-lang.org)
185 points | 81 commentspage 2
astro1234 4 hours ago|
Having written an open source Fortran library (for x ray scattering and absorption in a particular regime so this is fairly “niche” shall we say), genuinely curious: what if any advantages or strengths does Fortran have these days over other language choices? Are there circumstances where it’s arguably the “right” choice?
hatmatrix 3 hours ago||
A lot of the early, absolute advantages of Fortran (numerical precision, non-aliasing) has been adopted by C.

However what still makes it a great choice is that it still a relatively simple language compared to C, and maps mathematical formulas to code very well. Inelegant code will still run reasonably fast (which is not the true with C) - so all of these points make it actually a good language when the program is being written by domain experts (i.e., scientists) rather than professional programmers or software engineers.

vintagedave 3 hours ago||
May I ask: why did you write that library in Fortran? That is, what was your answer to your question at the time you wrote it?

I have heard that Fortran is very very good at optimizing array processing due to lack of aliases. That may be one answer today. There’s also value in continuity: in using a language for your task because it can build on what others have built. That applies to any established language, of course… but I could see it reasonably applied if someone wrote some kind of numerical processing library today. They’d write it in Fortran and call it from Python!

astro1234 3 hours ago||
The answer was “my adviser insisted because that’s the language he used”. I had to fight to use Fortran 95 and not 77. So I think like you say value was building on an existing community’s codebase in a language they were familiar with and comfortable with.
RetroTechie 6 hours ago||
More precise:

Many years of FORTRAN. Followed by many years of Fortran.

cpeterso 2 hours ago||
Google published a short video this week about how they used Gemini 4 Argon to migrate a Fortran code base to Rust: https://www.youtube.com/watch?v=biOWEPYyS5c
FabHK 6 hours ago||
I wanted to learn Fortran in the 1990s and borrowed a Fortran book from the university library. On the first or second page it stated "To mark comments, just punch a letter 'C' into the first column of the punch card." I returned the book and never learned Fortran.

Having said that, so many foundational libraries were implemented in Fortran (BLAS, LINPACK/EISPACK, LAPACK, MINPACK, FISHPACK, FFTPACK, etc.) - thanks for that.

PaulHoule 5 hours ago|
Mainframe-era systems often used fixed-size or limited-size buffers and data structures, based on those 80-character punched cards, most addressing modes on the 360 add 12-bit immediate displacements to pointers held in registers [1] bytes and such.

It is easy to laugh but C programmers have demonstrated that they can't handle variable-sized buffers on the stack, malloc(), free() and all that.

Early versions of FORTRAN [2] didn't even have a stack, like you couldn't write recursive functions, the program would take parameters for array sizes when it boots and the memory layout would all be figured out at the beginning. When I was developing a display controller for persistence of vision displays for the AVR-8 it drove me nuts how the C compiler kept moving the stack pointer around all the time for no real reason when an assembly program could move data to and from statically allocated structures. [3]

FORTRAN and COBOL came out around the time Syntactic Structures did so of course there was not an established theory for how to parse grammars, no parser generators, etc. No Dragon Book, but the heroic techniques used to develop compilers in that age are legendary if not quite lost.

I wrote some FORTRAN programs in high school on a VAX, in a comparative programming languages class in college, converted a lot of FORTRAN algorithms into statically allocated Java in grad school in 1990 and in my postdoc I wrote a generator that wrote JNI bindings for LAPACK.

[1] ... e.g. the typical struct is < 4096 bytes

[2] before the FORTRAN 90 standard though you could set the /RECURSIVE flag on DEC FORTRAN

[3] we were done such a disservice by all those "it's so elegant to compute Fibonacci in a better programming language than BASIC" articles in Creative Computing because recursion is one of those things, like C's memory management, that most programmers can't really handle.

kps 2 hours ago||
Fortran (before 90) ignored characters after column 72 because the IBM 704 had a 36-bit word and read each row of a card into two words. (The card reader could be wired with a plugboard to select any 72 of 80 columns from the card.)
jibalt 6 hours ago||
I learned programming in FORTRAN II on an IBM 1620 in 1965.
MaysonL 1 hour ago||
I’m still amazed that the first dozen programs I ever wrote back in 1963 for an IBM 7090 (or 7094) ran first time. (They were trivial programs). I’m also still pissed that I never got to debug the 13th, in FAP (Fortran Assembly Program), which had a minor syntax error – a comma instead of a period, or vice versa. NASA had just launched a weather satellite, which monopolized computer time, leaving zero minutes for high school students.
mcswell 2 hours ago|||
Nuts, I was going to post that FORTRAN (IV) was my first programming language, but that was in 1969. So you have me beat!
wglb 1 hour ago||
I started in 1966 with Fortran II on CDC 3500. Later I spent quality time on the IBM 1800 which has the same instruction set as the 1620.
hotelsacher 6 hours ago||
Happy birthday! I think this has to be the oldest programming language still in use. 70 years is quite an eternity in the sphere of computing. Before Fortran, there was (almost?) nothing but assembler and plug board connectors.
jibalt 6 hours ago|
https://www.guinnessworldrecords.com/world-records/397792-ol...

It beats LISP by a year and COBOL by two years.

leoc 4 hours ago||
And Fortran doesn’t just predate Lisp, it’s a direct ancestor. McCarthy was talking about LISP as a FORTRAN extension for quite a while during LISP’s development. The original Fortran is effectively LISP 0.
BeetleB 6 hours ago||
Have people moved on from Fortran 77?

It was frustrating that, 30 years after Fortran 77, professors were insisting in writing in that dialect. Thank God I escaped that hell.

Edit: Since people don't understand my point - I'm well aware of the existence of newer Fortran standards. But in much of academia, the professors insisted on sticking with Fortran 77.

btrettel 24 minutes ago||
Your experience is not universal.

I used modern Fortran in undergrad and grad research from 2011 to about 2015. I rarely ever encountered FORTRAN 77 back then, and never had to write any. I worked as an intern at NIST and LANL during that time too and it was modern Fortran there as well. At NIST, as far as I'm aware, that group had been using modern Fortran for probably a decade or more before I started in 2011.

I didn't have to write any FORTRAN 77 until 2025 in my current job when I was given a legacy code to work with.

sampo 1 hour ago|||
> Have people moved on from Fortran 77?

Apparently not. Fortran 90 standard was published 35 years ago, in 1991. But a majority of comments in this thread are about FORTRAN 77. It's like the last 35 years didn't happen at all.

jibalt 5 hours ago|||
After Fortran 77 came Fortran 90, Fortran 95, Fortran 2003, Fortran 2008, Fortran 2018, and Fortran 2023.
BeetleB 5 hours ago||
I'm well aware of it. And as late as 2007, I was forbidden from writing those dialects. Professors wanted everything in Fortran 77.
wglb 1 hour ago||
Interesting. Did they explain why?
dranudin 5 hours ago|||
Yes. With Fortran 90 most of the real archaic stuff was already gone. And they keep publishing new standards.
jleyank 5 hours ago||
There was a CS literature joke that I saw back in 1982. "Whatever language is used to program high-performance machines, it will be called Fortran.".
novaplan2026 1 hour ago||
still blows my mind that half the python data science stack is basically just a wrapper around 40 year old fortran code.
lproven 59 minutes ago|
I've read that, but I tried to find some examples and couldn't.
scott_meyer 2 hours ago||
Learn FORTRAN once, understand the C/C++/... linkage model forever.
jandrewrogers 6 hours ago|
FORTRAN is also the origin of using 'i', 'j', 'k', etc as loop variables in code, since 'i' was the first variable name that could be used for that purpose. The original language design was constrained by very primitive computers.
throw-the-towel 5 hours ago||
i has been the default variable for sum notation in mathematics long before FORTRAN. Here's an example dating from 1838: https://www.numdam.org/item/JMPA_1838_1_3__508_0.pdf
fph 1 hour ago|||
It might actually be the other way round: Fortran adopted the convention that i,j,k are integer variables because that was the standard in maths.
vintagedave 3 hours ago|||
Where in that doc, sorry? I thought I spotted something then realized it may have been a ‘1’.
tyromaniac 6 hours ago|||
Is that really true, if so, what's your basis? Fourier used i for the same purpose, and it definitely became a pretty standard indexing variable long before the 1950s. Most early code written in FORTRAN was essentially just transcribing formulae and algorithms that already would use such variable names.
jibalt 5 hours ago|||
The original language design was constrained by primitive thinking and lack of experience. The nature of computers in 1957 had no bearing on such things as variable names starting with I-N being implicitly integers ... that followed existing mathematical practice.
jleyank 5 hours ago||
"that followed existing mathematical practice". Not what I would call primitive thinking. It set out to handle math quickly and it succeeded. I/O wasn't its strength, and I'm sure the latest versions look like verbose C.
jibalt 5 hours ago||
[flagged]
whartung 6 hours ago|||
The reason 'i' was the first letter available was because by default identifiers starting with, I think, I-N were integers instead of float.

When I first started, with BASIC, my variable of choice was T simply because it was easy to type NEXT T in the FOR loops (why not R? I dunno...T just stuck).

kps 3 hours ago||
Other way around. I–N were integers rather than float because mathematics convention uses i, j, … as indices and n, m as sizes or counts.
eichin 1 hour ago||
The joke "God is Real (unless declared integer)" is definitely fortran-specific, though :-)
392 3 hours ago||
origins are very relative, it seems to have [started a bit before](https://stats.stackexchange.com/questions/176965/what-do-i-a...) :D
More comments...