Hacker News new | ask | show | jobs
by eesmith 15 days ago
Every time I've heard about a present-day Fortran code base it's because 1) Fortran is really good at those sorts of problems, and 2) lock-in because it's too hard to rewrite to another language, with little career benefit when you could be adding new features.
1 comments

It applies to all programming languages.

The whole "I rewrote X in Y" is mostly about career building, gathering Y portfolio, to jump ecosystems.

Now it doesn't matter any longer, it is one natural language paragraph away, what the output language should be.

My experience is that usually it's only 2), for example in large code bases written in MUMPS.

With Fortran it's 1) and 2).

As I understand it, Fortran outperforms other languages for problems like matrix math, especially if you care about issues like portability and memory use.

Not only is Fortran designed for those problems, but the there's been a lot of thought, time, effort, and money used to make the generated code go fast.

Yes, in a language like C++, which has been frequently used to substitute Fortran, the native support for arrays is very bad.

You can eventually obtain the same performance in C++ like in Fortran, by defining your custom array types, with a complete set of operators and functions for them, possibly using inline assembly or SIMD intrinsics for implementing trickier operations. The same may be true for other programming languages that are extensible enough.

But just replacing Fortran with another currently popular programming language is not sufficient, without some extensive support libraries.