DEV Community

Arhan Khan
Arhan Khan

Posted on

Fortran for Beginners: The 70-Year-Old Language Still Running Supercomputers

Fortran is the oldest programming language still in serious use — created in 1957, and still the language of supercomputers, weather models, and physics simulations. When a climate model runs on ten thousand cores, or a satellite's orbit is calculated, there is a good chance Fortran is doing the maths. It survives because it does one thing better than almost anything else: fast, reliable number-crunching on huge arrays.

Modern Fortran looks nothing like the punch-card code people imagine. Here is a small program that adds two arrays:

program add_arrays
  implicit none
  real :: a(5) = [1.0, 2.0, 3.0, 4.0, 5.0]
  real :: b(5) = [5.0, 4.0, 3.0, 2.0, 1.0]
  real :: c(5)
  c = a + b
  print *, "Result: ", c
end program add_arrays
Enter fullscreen mode Exit fullscreen mode

No loop, no index, no boilerplate: c = a + b adds the whole arrays at once. That array-first style is why Fortran is still fast — the compiler knows exactly what you mean, and it can vectorise the work across CPU cores without you asking.

Fortran is worth learning because it teaches you how high-performance computing actually works. You learn about memory layout, about why the order you loop over an array matters, and about how compilers turn simple maths into machine code that runs at full speed. Those lessons transfer to every language you use afterwards, from NumPy to CUDA.

How to start: install gfortran, the free GNU Fortran compiler, which is available on Linux, macOS, and Windows. Compile the program above with gfortran add.f90 -o add and run it. Your first project: a program that reads a list of temperatures, converts them from Celsius to Fahrenheit, and prints the average. After that, try a simple simulation — a falling ball, or heat spreading along a metal rod.

Who is it for? Science and engineering students, researchers in physics, climate, and aerospace, and anyone who wants to work on supercomputers. If you are building websites or mobile apps, Fortran is the wrong tool — but if your work is numbers at scale, it is still the standard.

The limits are honest: Fortran is bad at strings, web work, and general-purpose apps; the ecosystem is small and the tooling is old-fashioned. Treat it as a specialist language for scientific computing, not as a general programming language.

Your first step today: install gfortran, compile the array program above, and run it. Then change the numbers and run it again. You have just run code in a language older than the Moon landing — and it is still doing the hardest maths on Earth.

Top comments (0)