Risk of using Fortran

Is it possible that Fortran will lose compiler support (new language features, OpenMP, OpenACC, CUDA, etc.) when its user base shrinks to a certain point? How risky is it to write new projects in Fortran?

1 Like

Fortran will not die, there are several large packages that are important that depend on it. NASA may or may not use it, I suspect they do.

SciPy wraps highly-optimized implementations written in low-level languages like Fortran, C, and C++. Enjoy the flexibility of Python with the ā€¦ [If you write in Python - then may the Gods smile upon you.]

If you are real programmer you use Fortran C or C++. You might use C, opinions vary, mine is of the strong negative variant. You might try C++ and I know the developer, he and I attended some seminars at TAMU together, and then when you are relaxed, the beer has soaked in, your feet are in the sun and sand, and Fiji looks good behind you, you use Fortran.

There is a reason these major developers keep Fortran, my guess is it locked up inside DOD, NASA, the super secret one, and GHQC. I cannot remember the name of the supersecret one.

This post comes from a man who has spent the day inside MNIST and is entitled to a beer break and pub gossip,

I read a paper from the Numerical Recipes people once, it suggested that DOD had used an Oxford Don to develop the code for the cruise missiles.

At my Uni in Australia, the US gov had guards on the crypto place in 1975.

2 Likes

That is unlikely to ever happen. I am not a compiler developer, but I trust the words of seniors in the HPC world who told me it would take many decades to phase out or rewrite the massive existing Fortran codebases and projects, even if they do so. The worst scenario is extended delays in the implementation of future Fortran features.

1 Like

I think that is very unlikely. Adding on @macneacail 's answer. My industrial sponsor for my PhD, ANSWERS recently acquired by Jacobs, is (I think) the second largest software company in the nuclear industry by number of users and their code-base is almost entirely in Fortran.

Moreover, I know that other companies like Rolls Royce also have codes written in Fortran. Similarly, Cambridge University recently created a Monte Carlo framework for nuclear applications called SCONE which is almost entirely written in Fortran (if I recall correctly), my research group in Imperial College codes almost entirely in Fortran and Python and the list just goes on and on.

On the tool side of things, we have been putting a lot of effort (although in our spare time) to create high level tools, like package managers, code editor extensions, language servers, etc. to minimise the barrier to entry for newcomers. And although we are not in the same level as Python or C++ you have to keep in mind that we are also a substantially smaller community where people donate their time.

There are a lot of mission critical industries that have legacy code, or need to be extremely performant, so basically, all that is to say that I donā€™t see that as a likely scenario.

1 Like

If the fact that Fortran has outlived dozens of different hardwares and compilers is not convincing enough, here are a few signs of life:

Concerning the programming models:

  • Iā€™m almost certain we will not not lose OpenMP unless some extraordinarily better shared-memory programming model comes along; if you look at the OpenMP Architecture Review Board members there are 8 compiler vendors, all of which have their own Fortran compilers.
  • Concerning CUDA, I see no reason why NVIDIA would drop support for it. The first article linked below, states that ā€œAs of 2019, 9 out of the top 10 most power efficient supercomputers were using NVIDIA GPUs.ā€ Two years ago I met a guy working at NVIDIA in Munich, Germany, and he said they had projects upgrading commercials customers F77 software to run on GPUā€™s. Dropping support for CUDA at this point wouldnā€™t make any sense.
  • OpenACC has the biggest question mark with respect to Fortran, IMO. Still, Iā€™m aware of a few Fortran HPC codes which rely upon OpenACC.

Here are a few articles for a broader perspective than just Fortran:

3 Likes

In my view itā€™s extremely low risk.

  1. There are only more compilers with time, not fewer.
  2. User base is shrinking in a relative sense; it is growing in an absolute sense (personal perception).
  3. Even if all development stopped today, you still have a great language, specification docs, open source compilers, and an ecosystem of open source libraries and tools to work with.

The real risk of using Fortran is that youā€™d be tempted to use it for everything.

5 Likes

Industrial Finite Element Analysis is based on Fortran in large extend. Solvers like Abaqus Ansys, Nastran, LS Dyna are written in Fortran AFAIK. Top 4.

4 Likes

I would say that the risk is lower than that in using some other new pop-up languages coming around.

This link (in spanish) shows two current job offers in industry explicitly mentioning ā€œfortranā€, open at May 18th, 2022.

In some other companies job applicants are required to prove fortran experience in their interviews. No need to mention jobs in academia.

When it comes to ā€œcrunching numbersā€, fortran is part of the standard.

1 Like

This sort of question has been asked and addressed many times in the past. Here is a link to a 2014 article in Ars Technica, with hundreds of responses from readers.

1 Like

There is a famous quote in the Ars Technica article that @mecej4 linked:

ā€œI donā€™t know what the language of the year 2000 will look like, but I know it will be called Fortran.ā€
ā€”Tony Hoare, winner of the 1980 Turing Award, in 1982.

Fortranā€™s death has been repeatedly falsely predicted over ~50 years. I think Fortran will never die.

1 Like

I remember a day, in 1999, when some colleague at the uni told me: ā€œForget fortran. That is the past. You should switch to Haskellā€.

If you check the Tiobe index today, Haskell is below Fortran. What was the winning bet then? Who cares Haskell today?

https://www.tiobe.com/tiobe-index/

Fortran is a safe asset, so to say. I always tell the students they must know at least Fortran and C.

Edit: By the way, Fortran improved one position in Tiobe since April 22ā€™.

2 Likes

These last years, at least three compilers were developed: LFortran, the new Flang (NVidia), Intel ifx (to replace ifort)ā€¦

And as suggested by @milancurcic , if I understand him, the relative share of Fortran is shrinking but the cake is growing: the number of scientists and engineers in the world is growing each year. So maybe we donā€™t see the whole landscape from our national levels. Especially, if the countries in the one billion people club like Fortran, the situation is perhaps better than we perceive.

2 Likes

Of course the really important part is the boards, such as this one, and my personal living space the Intel Fortran Forum, which provide the Fortran support and the psychological support to someone struggling alone.

These places support new programmers, by answering stupid questions or questions we think are obvious, of course we are subject to the curse of experts, it is obvious to us, well sometimes.

Next time you are being hard on your grandchild because they are having problems with addition, try addition in hexadecimal in your head. It is hard. The tyranny of knowledge is strong in kindergarten teachers.

They support old programmers by providing friends, albeit friends whose humour is often measured in micro-Grouchoā€™s. One Groucho in England is a Scottish Joke and in the US is a Stephen Colbert monologue.

Of course, the absolute best days aside from my days with my children and grandchildren is a post from @mecej4. He/she - (TAMU is hot on not assuming gender) posts are usually dryly witty and to point, no surplusity (ink horn word) and the Saharan desert chuckles at the dryness.

Anyway back to work.

Shakespeare was often accused of not writing English as he used Ink Horn words. Safe to assume gender here, he is dead.


Why humour helps learning: This morning from a very good student:

Student: Iā€™m about to take a final. Iā€™m gonna fail. This [deleted as student uses language unlikely to be accepted on this august board.]
Me : Suck it up, I failed once it is a good learning experience, it haunts you forever. <Note, third year Algebra at ANU.>
Student : That gave me a good chuckle. And honestly that does kind of help

Check out Lindy effect.

5 Likes

So you are saying in essence that Fortran is akin to Madeline Carrol in the 39 Steps.
[Hitchcock] If you have not seen it - sit with your child and watch it and explain the olden days, ie before Fortran.

Fortran as a language will not die. But that should not be our goal. Our goal should be to make Fortran thrive, and get it to the point that there is no need to ask questions if it is risky to use Fortran. And we are clearly not there yet. I also share @karglā€™s concerns above. A lot of large projects are migrating away from Fortran, including SciPy, although slowly. We need to change that as well. If you want to help with that, letā€™s fix this issue:

If we can fix it, then I would say we made it. I think we might not be that far.

6 Likes

Why? Please donā€™t stoke unnecessary fires.

5 Likes

One of the risks is that your colleagues may not know FORTRAN or modern Fortran, and it is harder for you to work with them. I have a friend who uses D programming language almost anywhere. Whenever he tries to explain anything to me the chances are: either I have to google features of D-lang or he has to tell me the equivalent in C/C++. Is D lang a bad programming language? No, but if the user base shrinks to a certain point you become both a developer and a ā€œtranslatorā€. To be a good ā€œtranslatorā€ essentially you have to know two languages (at least).

3 Likes

I have no intention to ā€˜strike a fireā€™, and I doubt I am capable of starting a fire at all.
Coin has two sides, it may be useful to hear some different voices and opinions, although they may not be true, or you simply do not like them.
In fact, I am not sure if it is the most proper for an admin to just assume that I try to strike a fire, and then just hide my post. I take this as an offense.

I do not think there is risk of using any language as long as OP can get the job done. The content of the work is more important than a language itself. If really want risk-free, one at least need to be fluent in not only Fortran, but also some other languages. You do not put all fruits in just one basket.

The only problem of Fortran for me is that, gfortranā€™s performance on Windows is simply not as fast/consistent as it is on Linux. This prevents the usage of Fortran for developing open source software on native Windows, this is not great. This makes Fortranā€™s usage limited beyond HPC region. However there are work around, such as using Docker, or WSL to make gfortran perform at its normal speed by making it running on a linux enviroment.

1 Like

Is the D programmming language a larger user base than Fortran?

1 Like