1. 17
    1. 17

      I don’t think the first point is really true. Fortran didn’t avoid allowing aliasing to enable optimisations, it simply didn’t implement a complex feature. A few decades later, compilers were able to take advantage of the simpler data structures. Multidimensional arrays and so on are definitely not well supported in C/C++, but it’s weird to point at the rich set of optimised matrix maths libraries in C++ as a strength of Fortran.

      The third point is closest to the real reason, which I learned when I worked on a Fortran compiler in a past life. The entire Fortran compiler industry is funded by a single program. The DoE wrote this program in Fortran 77 and cannot (by law) modify it as long as the test-ban treaty is in effect, because they could not validate a modified version. They pay unbounded amounts of money for compilers that make this program run faster. All other uses of Fortran are possible because this program’s existence is subsidising an entire compiler industry.

      1. 5

        Fortran didn’t avoid allowing aliasing to enable optimisations, it simply didn’t implement a complex feature

        I am not so sure about this. Quoth fran allen (who worked on the earliest fortran compilers):

        C has destroyed our ability to advance the state of the art in automatic optimization, automatic parallelization, automatic mapping of a high-level language to the machine

        Talking about ‘features’ such as aliasing and unrestricted () pointer forgery.

        1. 2

          That is very interesting.

          because they could not validate a modified version

          But shouldn’t they have measurement data from back then, or ways to compare the output of this program with a new one ? It’s not easy, but should be doable.

          1. 6

            It’s not easy, but should be doable.

            Do you want to bet your nuclear deterrent on ‘should be doable’?

            1. 3

              It’s better for everyone if the nuclear deterrent doesn’t actually work, but it just looks like it probably does to anyone looking into it.

              1. 1

                Otherwise their only option is to never change anything at the existing program. Because “should be doable” is the same for changing anything, if you apparently can’t test it. And I doubt they don’t change anything ?

                1. 4

                  Correct. They do not change anything in the existing program. They recompile it with different compilers but that’s all (and then they do a lot of validation to ensure that it produces the same output as all versions from different compilers).

                  1. 2

                    How do they validate that the program compiled with a new compiler produces the same output as the program compiled with the original compiler? Couldn’t they use the same technique to validate a new version of the program?

            2. 1

              Is the law publicly available? That reasoning seems strange to me: if two programs produce identical outputs for known inputs, aren’t they identical for all practical purposes? When it comes to unknown inputs, both the old program and any new ones can only be validated by experiment, but since an experiment isn’t possible, one can only choose to trust those outputs or not. I can’t see what makes the old program more trustworthy for situations that weren’t experimentally validated.

              1. 2

                It’s probably this one. And from what I understood it’s less about comparing them and more that they don’t trust just comparing the programs. Also I doubt it’s just a single variable to test.

                1. 1

                  That law bans exploding nukes, not modifying Fortran programs. :)

                  From the wording I thought the law makes it illegal to modify the program that is used as a substitute for experimental testing.

              2. 1

                Do you have more info on this program and the law that requires it? I’d love to learn more but am not having much luck searching.

                1. 3

                  No, only feedback from the customer. They were also the absolute worst customers for a compiler. You’d get bug reports saying ‘the compiler generates incorrect code’, and you’d say ‘please provide a test case’ and they’d then take 6-12 months to declassify something and then their test case would be so much changed from the original that it wouldn’t trigger the bug.

                  1. 3

                    We found a bug in SQLite. We couldn’t figure out what was causing it. Even the slightest changes to the inputs dodged the bug. We were working on a government project and we had the humorous problem of having to figure out how to send the SQLite folks out the data that triggered the bug when we weren’t actually allowed to send them the data.

                    Finally we found some data that would trigger the bug that wasn’t derived from anything we couldn’t distribute, got it approved, and submitted the bug.

              3. 6

                I like the still in the title. I bet Fortran will be used in the next two hundred years.

                1. 9

                  I recall someone from Sun in the late ’90s who said ‘I don’t know the syntax of the language that we’ll use for HPC in 50 years. I don’t know what the semantics will be. But I know it will be called Fortran.’

                  1. 4

                    I translated some linear algebra tutorial code from Python/Numpy to Fortran and boy is Fortran fast and actually nice to use