Live data from Hacker News

Why physicists still use Fortran (2015)

moreisdifferent.com

1–10 of 300 posts

Re: Why physicists still use Fortran (2015)

#2
Our physics group has a core library, first written in 1987, that is in Fortran (a Microsoft dialect, to be specific).

Why haven't we moved to something else? It works, it is time-tested, and the original author continues to maintain it.

(P.S. I'd like to compile it with the gfortran tools, in order to preserve the library for the future. Is there any documentation for simple conversions from Microsoft's implementation of the language to the more-traditional spec?)

Re: Why physicists still use Fortran (2015)

#4
FORTRAN is still great for fast numerical applications and easier for me to read than C++.

My industry is rewriting its FORTRAN base in C++ and a lot of physicists are switching to Python + Numpy for all but the most intensive tasks. I see FORTRAN being only used in legacy systems within the next 5-10 years.

Re: Why physicists still use Fortran (2015)

#5
> Interestingly, C/C++ beats Fortran on all but two of the benchmarks, although they are fairly close on most.

I think this is fairly recent that C/C++ wins. I don’t know how recent exactly, but I remember a colloquium not too long ago by a compiler researcher who said that cross-compiling to Fortran and then optimizing almost always produced faster code than the C/C++ compiler could. Fortran is apparently easier to optimize.

Re: Why physicists still use Fortran (2015)

#6

Same reason why string manipulators still use Tcl.

I think that's more of once a language has a hold on a particular industry (Ex: TCL in semiconductors), it takes awhile for something else to replace it due to all the in-house code written in it. If the vendor uses only a TCL API, then double the time to switch. Assuming TCL isn't doing a great job serving their needs.

Re: Why physicists still use Fortran (2015)

#7

FORTRAN is still great for fast numerical applications and easier for me to read than C++. My industry is rewriting its FORTRAN base in C++ and a lot of physicists are switching to Python + Numpy for all but the most intensive tasks. I see FORTRAN being only used in legacy systems within the next 5-10 years.

FORTRAN is still in much of the R Core. Fortran is faster than C++ and I actually feel that many people are starting to realize why we still have FORTRAN around.

Though there are many using Python + Numpy R still have a larger piece of user base in scientific and mathematical spaces.

Re: Why physicists still use Fortran (2015)

#8
Physicists / engineers / mathematicians are the target audience for Fortran. For heavy number crunching it's still quite good, it's people trying to use it for other stuff that causes problems.

That said, Fortran really is dying. Scientific code is much larger nowadays with more functionality and scientists want to do everything in one language. C++ and Python are taking over.

Re: Why physicists still use Fortran (2015)

#9
On array convenience: Fortran also supports optional runtime bounds checking of array indexes. I've worked writing signal processing code in Fortran, and it's really quite nice to have that when doing dev, even if you turn it off in prod for performance reasons.
Post reply on HN