Saturday, April 28, 2007

FORTRAN at 50, inventor John Backus passed away

There are many technological tools that we often take for granted, and where we do not think about that someone, at some time, had to invent or create them for the first time. This is even more true for abstract things such as computer codes, or progamming languages.

For example, I had never heard before of John Backus, until I read his obituary in this week's Nature (subscription required). He was the creator of FORTRAN, the first higher programming language. He passed away on March 17, 2007, at the age of 82. There have been several obituaries published before, i.e. in New York Times, the
The Sydney Morning Herald, or the Guardian.

Backus tried, quite unsuccessfully, to become a chemical engineer and a medical doctor, before he found his vocation in mathematics. Around the time he was finishing his a Master's degree from Columbia University, he visited a showroom exhibition of IBM, where the company presented its latest computers. He talked to some of the representatives there, and at the end of the day, he had a job at IBM.

At that time, in the early 1950s, IBM had started to build and sell computers in series. While hardware thus was more easily available - at least for big universities and companies, or governmental institutions - the problem of programming these computers became critical. Programs had to be written in machine code, in the series of zeros and ones the computer could understand, and this was a tedious and error-prone task, which required much training and could done only by experts.



The IBM 704 computer room at Lawrence Livermore, October 1956. The FORTRAN compiler was developed by John Backus to write programs for this computer. (Source: Lawrence Livermore National Laboratory, Historical Computer Photos


So, Backus had the idea to develop a program that would be able to translate some formal description of an algorithm into the right series of zeros and ones, the machine code the computer would operate with. This was how FORTRAN; the FORmula TRANslator, came into being. The FORTRAN compiler was released for general use with the IBM 704 computer just 50 years ago, in April 1957.



The title page of the IBM 704 Fortran Manual with an autograph by John Backus himself and the names of the people who worked on the first Fortran compiler. (Source: www.fortran.com)


By some curious coincidence, I never actually used FORTRAN for scientific computing. I had landed on an island of C/C++, while everyone else around me was constantly relying on FORTRAN for running simulations or coding small programs to find a quick numerical solution to some mathematical problem. I only realised that it had some funny formal features, for example with respect to the line length, which made me some headaches when I once tried to write a small program in FORTRAN. But once you realise that, actually, this compiler is a reliable tool back from the stone age of electronic computing, you probably can be tolerant with such idiosyncracies.



More about Backus can be found in the IBM Archives.
Here is an iteresting text about The history of the FORTRAN programming language.

Tags: ,

18 comments:

Bee said...

Hard to believe that fortran is already 50... nice photo.

I just love fortran - though I made some effort learning C, I still prefer it. It is flexible and not picky with definitions. I just wish someone could explain me why lines have to start with the 7th letter. I remember more than one occasion where this profound knowledge of mine saved a desperate grad. stud. who was trying to compile his first code. Best,

B.

wolfgang said...

I just read that C.F.Weizsaecker passed away at the age of 94.

ChickenBreeder said...

The restrictive format (codes must be typed between the 7th and 72nd letters of a line) has a historical reason. Back when computers have very small memory, codes were written and stored on punch cards. When one needs to compile and run a program, the cards are fed into a reading machine, and so on. Each card is something like a line of code. The 80-letter-per-line format corresponds to the physical constraint of the cards and is therefore very strict. Newer languages like C doesn't have such restrictions because by the time they were invented the punch card era was fading away.

But Fortran has progressed, too. Fortran 90 and beyond don't have the restrictions on line length.

amaragraps said...

Dear Stefan and Bee, I am one of those who remember using those IBM 80-column punch cards in Fortran. Beware of dropping your stack of cards on the way to the card reader ... :-)

stefan said...

Hi Chickenbreader,

thanks for these explantions - together with the foto of the punchcard, that makes a lot of sense...


Dear Amara,

I also remember these cards - I had lots of them as a child, from my uncle wo studied mathematics and worked on numerical problems.

Now I think I understand how they work :-), there are these 72 columns with numbers 1 to 8 designating eight bits, which produce an eight-bit code when holes are punched in - is that right? And one can see that the first colums are not used for coding, so that's how comes this funny restriction... interesting :-)



BTW, I could not find any information whether the main processing unit of this IBM 704 was using already transistors, or if it still worked with vacuum tubes? Web sites tell that for the memory, grids of ferromagentic rings were used, which was an innovation, but are silent about the main processor...

Best, stefan

Anonymous said...

Hi Stefan,

I'd say tubes. See:
http://preview.tinyurl.com/2mm37k

Best,

Andreas

CarlBrannen said...

The definition of Fortran has changed over the years. The older versions, like Fortran-66, are far more simple, elegant, and easy to use than the modern versions. The reason is that they kept adding constructs from more modern languages.

I started college in 1976 and Fortran was very common. I was fairly good at it. I feel very sorry for students who try to learn it nowadays, it is much more difficult.

amaragraps said...

Dear Stefan,
I don't know, but I would also suggest 'tubes'.

Bee said...

I too remember these cards... we used to play with them as kids :-)

Anonymous Snowboarder said...

The worst trick to have played on you in college was for one of your roommates to rearrange part of your deck - sometimes it was only one or two cards but oy what a headache.

As to the col 7 start, well everything has its place when dealing with punch card originated languages. Column 1 could be marked as 'C' for 'comment' or 1-5 used for labels (numeric in early versions of FORTRAN) and generally used for gotos. Col 6 is the place to mark a line as continuation of the prior. In theory, 73-80 were unread and could be used however you wished, such as for numbering.

Arun said...

Backus to the future!

As I understand it, Fortran remains around because it is possible to compile it to very efficient machine code, and also to make it run on multi-processor machines.

C/C++ suffers from a difficult problem (I forget the name - memory alias? disambiguation?) where it is difficult for the compiler to figure out whether two different names are referring to the same memory object or not. So more care is required to prevent multiprocessors from stomping all over each other, and unless the code is carefully structured, optimizing it is more difficult than with Fortran.

I don't hesitate to write the above, 'cos someone will correct me :)

amaragraps said...

Arun, I would say the bigger reason that Fortran is around today is the large number of very useful numerical libraries and legacy scientific code written in Fortran. (And ... those busy scientists have simply run out of time to learn a new programming language(s))

Bee said...

Hi Arun,

ah, no idea, sounds sensible to me. My problem with C is that I that I find it just very complicated. I mean, I was able to write some codes that actually did what they were supposed to, but I found the process really painful. That starting with me being unable to use any sample files because they didn't compile properly (for reasons I wasn't able to find out), packages not found (or whatever that was called), variables not defined EXACTLY the right way, not to mention all these {} hanging around. And the absence of a useful documentation. The alternative would have been to use visual C++, which never quite did what I wanted it to (no idea who would want to work with that).

Fortran has it's own drawbacks though. One thing I hopefully won't forget again is that it's kind of crucial to define arrays with the correct length. At some point I managed to write a code which produced a different result each time I run it. I found that quite remarkable actually.

Hi Anonymous Snowboarder!

Thanks, this makes a lot of sense! I didn't realize this was a leftover from THAT early times... As I wrote above I wouldn't have thought Fortran is that old. I probably would have placed it somewhere early 70ies or so.

Best,

B.

Gordon said...

Bee: I remember taking my stack of cards to the IBM 360 control room ( how's that for dating myself). Also, do you remember APL, a kind of neat recursive programming language invented at your Waterloo by Iverson. I dont think it is being used any more. My son used Yak, Lex and C to write code for RPL a numerical relativity program.

Bee said...

Dear Gordon,

no, sorry, I don't remember that. Actually, until last year I was convinced Waterloo is somewhere in Belgium.

I do remember learning pascal and basic though. I still recall how I wrote a program for the C 128 that printed a Mandelbrot set. It took a whole 24 hours to run (even though the resolution of the screen was low so there weren't actually that many points to be computed). My brothers were pretty pissed off because they couldn't play pac-man for a whole day ;-)

Best,

B.

Anonymous Snowboarder said...

Hi Bee,

All my snow is melted :(

amaragraps-

something to consider in regards to old code and routines surviving in such lanuages as FORTRAN and COBOL is that they are thoroughly tested and well understood. Its more than just translating from one language to the other - one must verify there are no imprecisions introduced.

amaragraps said...

Anonymous Snowboarder: Yes, I should have said that too, it's absolutely true. For example, here you can find well tested Fortran numerical analysis code.

Anonymous said...

Thanks for the post about John Backus, a little-know person who has had a huge influence.

I worked as a programmer on a technical project for several years and worked heavily with a variety of languages. With respect to one particluar project I was working on, these are my observations: the core, that is, the scientific/mathematical parts are done in FORTRAN of a variety of flavors, but mostly Fortran 77. The GUIs of the software are written in C/C++.

If I have to write code to do scientific/mathematic manipulations, I do it in Fortran, and if I want to write a nice GUI around it I'd write it in C/C++ (or Visual Basic, for something that runs in Windoze). It's a question of using the right tool for the job.

I also agree with Amara and anonymous snowboarder's observations abotu Fortran.

Cheers, changcho.