Remix.run Logo
almostgotcaught 3 days ago

What is the point of this? Fortran is both faster than cpp and easier to write than cpp. It's also by no means a dead or dying or whatever language. Smells like literally "your scientists were so busy they forgot to ask why".

jandrewrogers 3 days ago | parent | next [-]

Seems pretty obvious to me, and I’ve written my fair share of both Fortran and C++. I think it is mostly that very few people know Fortran anymore and even fewer people want to maintain it. A vast number of people in 2025 will happily work in C++ and are skilled at it.

Fortran also hasn’t been faster than C++ for a very long time. This was demonstrable even back when I worked in HPC, and Fortran can be quite a bit worse for some useful types of performance engineering. The only reason we continued to use it was that a lot of legacy numerics code was written in it. Almost all new code was written in C++ because it was easier to maintain. I actually worked in Fortran before I worked in HPC, it was already dying in HPC by the time I got there. Nothing has changed in the interim. If anything, C++ is a much stronger language today than it was back then.

pjmlp 3 days ago | parent | next [-]

Fortran is still quite modern despite its age, and relevant enough that not only has one of the success factors of CUDA, the availability of Fortran on the CUDA SDK, LLVM project also started a Fortran frontend project.

Also to me seems more likely that people that enjoy Fortran in HPC are more likely to change to Chapel than use C++.

walleeee 3 days ago | parent | prev [-]

> Almost all new code was written in C++ because it was easier to maintain.

What makes you say so? See musicale's comment above. I have a hard time seeing C++ as easier to maintain, if we are just talking about the language. The ecosystem is a different story.

jandrewrogers 3 days ago | parent [-]

For pure number crunching, Fortran is nicer. Unfortunately, performance for most codes became about optimizing memory bandwidth utilization at some point in the 2000s, and systems languages are much more effective at expressing that in a sane way. It was easier to make C/C++ do numerics code than to make Fortran do systems code. Some popular HPC workloads were also quite light on numerics code generally, being more about parallelization of data processing.

This was before modern C++ existed, so most of the code was “C with classes” style C++. If you can read C then you can read that code. I don’t consider that to be particularly maintainable by modern standards but neither is Fortran.

Modern C++ dialects, on the other hand, are much more maintainable than either. Better results with a fraction of the code. The article doesn’t say but I would expect at least idiomatic C++11, if not later dialects.

jabl 3 days ago | parent | prev | next [-]

Some people at LANL seem to be on a holy crusade to replace Fortran with C++. They occasionally produce stuff like papers saying Fortran is dying and whatever. Perhaps it makes sense for their in-house applications and libraries, but one shouldn't read too much into it outside their own bubble.

jeffbee 3 days ago | parent | prev | next [-]

I wonder if they feel that the toolchains are just rotting.

almostgotcaught 3 days ago | parent | next [-]

But they're not

https://github.com/flang-compiler/flang

https://flang.llvm.org/docs/

xvilka 3 days ago | parent | prev [-]

Unlike C++, they even got their standard package manager - fpm[1].

[1] https://fpm.fortran-lang.org/

pjmlp 3 days ago | parent [-]

It is as standard as vcpkg and conan.

ISO Fortran does not acknowledge the existences of FPM, just like any programming language ISO standard, the ecosystem is not part of the standard.

mkoubaa 3 days ago | parent | prev [-]

This. If someone can't correctly articulate the advantages of Fortran they shouldn't be migrating away from it. This is not to say that migrations should never happen.

greenavocado 3 days ago | parent [-]

Chesterton's Fence