5 ms·
But does “code quality” matter if all you need is a black box calculation that spits out the right answer every time, and has done so for the past 50 years? Pu
by ImprovedSilence 5y ago
But does “code quality” matter if all you need is a black box calculation that spits out the right answer every time, and has done so for the past 50 years?
Put all the damn goto statements in there you want, as long as I don’t have to look at at, great!
- adgjlsfhk1 5y agoIf your code is performance critical, it absolutely matters. Most Fortran code is FORTRAN 77, and 2-20x slower than it could be because it was written for processors without vectorization, out of order execution, modern branch predictors, or any of the other hardware advances of the past 30 years. Modern compilers can mitigate this slightly, but the algorithms that old FORTRAN code use are fundamentally inefficient on modern hardware.
- ogogmad 5y ago> vectorization, out of order execution, modern branch predictors Two out of three of those are controversial because of Spectre. https://en.wikipedia.org/wiki/Spectre_(security_vulnerability) https://en.wikipedia.org/wiki/Spectre_(security_vulnerabilit...
- adgjlsfhk1 5y agoThey might be "controversial", but they still are absolutely necessary. Modern CPUs typically execute around 3 operations per clock cycle. Without OOO and speculative execution, that drops to .3 (roughly). There's a reason no one is making cpus without them for anything even performance adjacent. Also, just because Fortran code was written without knowing about them, doesn't mean they don't still happen, the only difference is that the algorithms are bad.
- pjmlp 5y agoWhen I was at CERN, the surviving Fortran code that I related to, was decent Fortran 95.
- hilbert42 5y ago"Most Fortran code is FORTRAN 77" Just curious, how do you know that? I would have thought many establishments would have moved on by now. That said, I've a few of my personal programs that still run on IV - no need to change them as they still work fine (but then they're not running under the auspices of some institution where updating has relevance). I suppose a more relevant question would be what is the breakdown type of institution still using 77 - educational, research, government, commercial etc. (I know airline bookings and traffic systems used a lot of 77 until recently). I note from another poster CERN is using 95. I'd reckon legacy systems would be more likely to be found in govt. and commercial and updated more likely in research. (I'd expect there'd be a large disparity between the different types of institutions.)
- adgjlsfhk1 5y agoI haven't done a survey, but from what I've seen, most establishments have moved on. They moved on to C++, python, and julia. Fortran is still fast, but it no longer is unambiguously the fastest, so you need a really specific reason to write code in a less expressive language. (There's a reason the Fortran people are writing their standard library in Python)
- hilbert42 5y agoRight, thanks. That makes sense, especially julia. Trouble is I keep falling over Fortran in many unexpected places. What I've not thought to do in any rigorous way until now is to ask about the history of these Fortrans.
- TheRealKing 5y agoIf you have not done a survey, then please do not make generic claims in a public forum about a whole ecosystem based on your limited personal observations. I understand you like Julia very much and that you are possibly paid by JuliaComputing to bash other languages in online forums, specifically Fortran here, but please keep your discussions factual.
- adgjlsfhk1 5y ago