For scientific and high performance computing Algol was considered, and possibly is still considered by some, to be a more powerful language than Fortran. For the same algorithm encoded in both languages and using the same data, which of the two languages executed programs the fastest?


My experience has been if you want to do intensive number crunching, such as might be used for, say, weather forecasting, use Fortran. In the past that used to be FORTRAN 77, now it's modern Fortran (90, onward ...).

I know some software packages used by the mining industry, originally written in FORTRAN 77 in the 1980s and 1990s were later rewritten using C, just to get them "modernized". Apparently computational speeds were reasonably similar.

Physicists and those involved with the cosmic sciences have need of high speed computer processing and they still use Fortran, whether it be old FORTRAN 77 or modern Fortran 90/95/03/08 ...

To moderize, some use C++, but FORTRAN/Fortran is still part of their software toolkit and will be for some time, irrespective of implementation.

Python, which is the darling of computer scientists, is usually about 100 times slower, but that is the nature of interpreted code. Python is unsuited for heavy numerical computation, ...

... irrespective of implementation. This is partly why MIT developed Julia.

In my reading, a number of people have commented how Algol was so much better or preferred than FORTRAN.

This then begs the question, for a given implementation, was Algol faster than FORTRAN?

  • 1
    Welcome, Fred! Are the language libraries in scope for this question? Languages used for numerical processing have highly optimized libraries, possibly in assembly, to do the heaviest numerical lifting; it is possible that these libraries are what makes one faster than another. Optimized libraries can be provided by a third party, not just the compiler's supplier. – Wayne Conrad Oct 1 '20 at 15:36
  • 3
    That's 3 languages - Algol 60 and Algol 68 are not even close to being one language. – another-dave Oct 1 '20 at 17:03
  • 7
    tl;dr - languages don't execute programs; implementations do. – another-dave Oct 1 '20 at 17:08
  • 1
    What do you mean by "compared with Fortran." The Fortran 2018 standard supports user-defined data structures, OOP, inter-language compatibility, concurrency (parallel computing), and more. And "essential" language features of Fortran 77 like COMMON, EQIVALENCE and BLOCK DATA are now flagged as obsolescent. Algol 60 (or 68) isn't remotely comparable. Algol 60 didn't even have any standardized I/O capability - everything was implementation dependent. – alephzero Oct 1 '20 at 20:15
  • 2
    Words like powerful have lots of meanings in computing. Some languages may be considered powerful because they can do things that other languages can't. Performance wise they may be totally crap but you may be able to write a 50 statement algorithm from another language in one or two statements. – cup Oct 2 '20 at 5:53

Theoretically, assuming two equally optimizing compilers, an Algol program may be either faster than a Fortran program implementing the same algorithm, if in Algol all subroutine parameters are declared as value, and accessed from within the subroutine more efficiently that in Fortran (where everything is passed by reference); or slower, if they are not, and are passed by name, resulting in re-evaluation of the actual argument every time when the formal argument is needed.

Also there may be a difference in computing index expressions and in memory access pattern due to the difference in array layout between Algol and Fortran (row-first or column-first), resulting in a difference in performance one way or the other.

In my experience, though, more effort was put into adding optimizations to Fortran compilers rather than Algol compilers due to greater demand.

  • 1
    The combination of call-by-name and recursion put "writing an optimizing Algol compiler" out of reach of most development teams who were producing optimizing compilers. And for practical purposes, a language specification with no standard I/O facilities at all was inevitably going to be a chocolate teapot. (Of course call-by-name + recursion mean you can write some really cute academic algorithms, but real world computer users weren't very interested in that). – alephzero Oct 1 '20 at 18:37
  • I disagree about I/O. The implementations I used had pretty decent I/O. I wasn't interested in portability anyway. – another-dave Oct 1 '20 at 22:41
  • If this is true, it will only be true for programs (algorithms) using subroutines, isn't it? Many problems can be formulated without. – Raffzahn Oct 2 '20 at 9:41
  • 1
    @Raffzahn Naturally, some problems are so simple that when written in Algol and Fortran, two equally optimizing compilers could compile them equally efficiently - like bubble sort, for example. I don't think the scope of the question is that narrow. – Leo B. Oct 3 '20 at 5:21
  • @alephzero About recursion and call-by-name - precisely. – Leo B. Oct 3 '20 at 5:23

For scientific and high performance computing Algol was considered, and possibly is still considered by some, to be a more powerful language than Fortran.

Was (is) it? It might be great to have some reference to this.

For the same algorithm encoded in both languages and using the same data, which of the two languages executed programs the fastest?

A serious would depend on many parameters not given, like:

  • what time it is about
  • what machine
  • what configuration
  • what compilers are to be compared
  • which algorithm
  • which implementation (of the algorithm)
  • how close it is done to the machine structure

and so on.

Or as another-dave nicely put it:

tl;dr - languages don't execute programs; implementations do.

  • We had to do coursework on programming language comparison when I was in Uni. Same list as @Fred plus SNOBOL. – cup Oct 2 '20 at 6:02
  • 1
    "powerful" is one of those nebulous terms that can mean whatever the user wants it to mean. Usually, it means that the language has constructs that help the programmer express certain paradigms more easily and/or concisely. With respect to Algol and Fortran, recursion would be one such paradigm. I've rarely heard the term used to mean "produces faster code". – JeremyP Oct 3 '20 at 9:43
  • On the other hand, a powerful language can help the programmer to produce the code faster. If a certain task written n Fortran takes an hour to run but two hours when written in Algol, that's bad for Algol, right? Well not if t took you eight hours to write the code in Algol and sixteen in Fortran and you only want to run it once. – JeremyP Oct 3 '20 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.