Fortran Specialist Group

FORTRAN versus Algol

I.D. Hill

I shall be talking about Fortran as I knew it up to the 1977 version. I have no knowledge of what may have happened to it since then, but as this is a historical meeting, I do not regard those later developments as relevant to this talk anyway.

In talking of Algol, I shall mean Algol60. There was a later language called Algol68, which never made much headway, but that was really quite a different language and also not relevant for today's meeting.

It has been said that most computer programmers regard the first language they learnt as the ideal one and never lose their love for it. That is not true in my case since the first language I learnt was Mercury Autocode, which I certainly enjoyed at the time, as I would have enjoyed anything that gave me access to the joy of computers, but I should not wish to return to it now. It was good for its time and certainly had some interesting features.

After some years using London University's Mercury, it was replaced by the Atlas. That had a Mercury Autocode compiler and I should probably have continued to use it, at least for a while, as many people did. It was one of my colleagues who suggested to me that perhaps we ought to try Algol as the Atlas had a compiler for that too and, unlike Mercury Autocode, it was an internationally recognised language. So I agreed to try it.

At first I was not very impressed by Algol. It seemed too wordy and a little obscure in its appearance, and its formal definition, in the Algol Report, looked frightening at first. That first impression only lasted a couple of weeks -- the conversion, of realising how simply I was now doing things, and the things that were now possible, was quite sudden and overwhelming. Mercury Autocode went to the dustbin of "good for its time but...". This was an immense step forward, and the things that had put me off at first all became advantages, not disadvantages, once one really understood them. In particular, it was marvellous to find the extent to which one could throw away all the textbooks, and never resort to trying things on the machine to see what happens, because any doubts were so well dealt with merely by looking at the Algol Report which was amazingly comprehensive for its size.

I learnt to understand Algol so well that I once overheard the colleague who had first persuaded me to use it discussing with somebody else a point that they found obscure, and before asking me about it, I heard him say "Let's consult God". I doubt whether there is any other context where that could be said of me.

All was bliss for a few years.

I learnt to love computers so much that when the Medical Research Council, for whom I was working, decided to set up their own computer unit, I volunteered to become part of that. The computer that had been chosen for it was the SDS 9300, in many ways a pleasant beast, but the person mainly responsible for choosing it had done so on the basis of its having a very good Fortran compiler, although practically nobody in the MRC used Fortran at that time. It was supposed to have an Algol compiler too but, in preliminary tests, we found it to be so faulty that we rejected it and at least we never paid for it.

So, after Mercury Autocode and Algol, I now had to get to know Fortran. And oh dear, oh dear. Having made the wonderful jump from Mercury Autocode to Algol, this was right back to square one. There were many differences between Mercury Autocode and Fortran, of course, but the overall feel seemed to me to be just the same. What a comedown.

In one way I made Fortran a little clumsier than it needed to be on that particular computer as I insisted, as far as I possibly could, on sticking to the 1966 standard and not using the supposedly-splendid extra features supplied. That may not have helped at the time, but payed off handsomely in the end because, when we next changed computers, to a PDP-11, my programs continued to work while other people's programs were failing in all sorts of obscure ways.

Anyway, I had to make the best of things, became fluent in Fortran, and got to see many virtues in it. So although I was still lamenting the loss of Algol and the return to the dark ages, I did begin to wonder whether I was looking at it through rose-tinted spectacles. Was it like losing a girl-friend and thinking for years how wonderful she had been, only to meet her again later and wonder what had been so attractive? Not that that has ever actually happened to me, but I am told that it is a common experience.

Then another change of computers brought in the DEC-20 machine, which had both Fortran and Algol compilers, so I decided to try Algol again and see whether I had been misleading myself. I had not. All the old magic was back. I loved it more than ever and busily took to translating my Fortran routines.

Incidentally, just as there is no way of learning something as good as teaching it, there is no way of understanding a computer program as good as translating it. To be fluent in more than one programming language has that advantage, whether translating from Fortran to Algol or the reverse.

At a later date, with another change of computer, Algol became unavailable again and I switched to Pascal as the nearest that was available. All my programming nowadays is done using that Pascal compiler. I regard Pascal as a very poor language compared with Algol, a few minor and unimportant steps forward perhaps, but such massive leaps backward to go with them as to be quite absurd. The one good reason for using it instead of Algol is that I have a compiler for it.

There were some things in Algol that, with hindsight, can be regarded as mistakes. The principal one is found surprising by the Fortran-lovers -- it is that the language includes labels and goto-statements. Those who really understand Algol never use them. They clutter up compilers, cause some logical difficulties, and allow inexperienced users to produce messy programs that are difficult to follow and likely to be faulty.

So if, in the experience of myself and some others, Algol was so much better than Fortran, why did Fortran succeed in taking over the world to the extent that it did, pushing Algol to the sidelines? I think that it was partly that IBM were so powerful in the computing world at the time, and did not wish to promote a language over which they had no control, partly that a preliminary language, now known as Algol58, was so rapidly overtaken by Algol60 and nobody knew whether that would be equally short-lived, partly that the original version did not include any input-output statements as standard.

When it was decided to add a standard input-output, a committee under Donald Knuth produced something that most Algol users thought of as like Prince Charles's description of a proposed extension to the National Gallery -- "a monstrous carbuncle on the face of a much loved friend". Then there was the disaster of the International Standardization Organization who took too many years to produce an International Standard which, when it finally appeared, was so full of mistakes that it had to be withdrawn. Additionally, some people thought that Algol68 had replaced it.

So we lost the battle -- what a pity.

Eventually we produced a version called Modified Algol60, that cleared up some minor troubles and made its way through to become an acceptable International Standard. But it was too late. So far as I am aware, nobody ever implemented it.

The latest that I knew of Fortran developments, the 1977 standard, it seemed to me that it was slowly and painfully trying to work towards where Algol had been as long ago as 1960, but it was never actually going to get there. I may be better informed on where it has now got to before the end of today.

Comments on this or any other of the Group's pages should be sent by email to the FSG Web Editor.
Valid XHTML 1.0 Transitional Valid CSS!

Last modified: Sun 9 Dec 2012 15:00:40