Why isn't Fortran cool in 2025?
On the surface Fortran has it all. Highly optimised compilers for many (if not all) platforms, awesome multi-dimensional arrays for use in numerical algorithms, a reasonably readable syntax, semi-automatic dynamic memory handling, etc.
The main problem with modern Fortran is that there is too much friction:
- The language is generally perceived as old and outdated, there are "much better" modern alternatives, which is likely true if you are writing code that is anything but numerical algorithms. (Btw, C++ is now more than 40 years old.)
- The lack of a reasonable complete standard library. (There are several projects, but none is anywhere near completion.)
- The lack of consensus on how to write modern Fortran code.
In this decade there are still very simple questions where Fortran experts cannot provide a simple answer on how to write modern Fortran code, like:
- Which source file extension should you use
- What is the best way to declare a double precision in Fortran?
- What is the normal boiler plate code required to write a new code module? It seems that everyone have their own interpretation, and your choice will impact how cross platform compatible your code is, and which libraries you can link to.
New users of Fortran will have to learn to use opaque statements like implicit none
, use, intrinsic :: iso_fortran_env, only: dp => real64
, etc. in order to get things done.
In most modern languages these questions are all decided on the compiler level, with sensible defaults for users of the languages. But, Fortran is "flexible" enough to make this a mess for everyone, which makes it harder to adapt code you find on the Internet, and requires that you are very particular about style when asking your favourite AI to write code for you.
Despite its clear benefits for writing code related to numerical algorithms, and interesting new projects like LFortran, I don't see a bright future for Fortran.