◷ Computing history

FORTRAN: John Backus and the first successful high-level language

How FORTRAN was born at IBM between 1954 and 1957, why its optimising compiler won over the sceptics, and what remains of the language today.

Today we take it for granted that a programmer writes formulas and loops in a readable language and that a compiler translates them into efficient machine code. In the mid-1950s this was far from obvious. Many experienced programmers were convinced that no automatic program could produce code as fast as hand-written code. FORTRAN, developed at IBM by a team led by John Backus, proved the opposite and changed the way an entire generation of scientists and engineers worked.

The cost of programming

In the early 1950s computers were extremely expensive and machine time was the resource to economise. But Backus noticed that the cost of programming and debugging was becoming comparable to, if not greater than, the cost of the machine. Writing a scientific calculation in machine code or assembly language took weeks and produced programs that were hard to read and modify.

At the end of 1953 Backus proposed to his managers at IBM the development of a system that would allow programs to be written in a notation similar to mathematics. The project was approved and the team began work in 1954. The name FORTRAN comes from FORmula TRANslation.

The efficiency challenge

The team knew that the language would be accepted only on one condition: the generated code had to be almost as efficient as code written by hand by an expert. If a FORTRAN program had been twice as slow, customers would have kept programming in assembly.

That is why a huge part of the work was devoted to optimisation: the compiler analysed the program to remove redundant calculations, make the best use of registers and generate efficient loops, particularly for accessing array elements. The first FORTRAN compiler, delivered to IBM 704 customers in the spring of 1957, is regarded as the first optimising compiler in history.

The result exceeded many people's expectations. In many cases the generated code was comparable to hand-written code, and the time needed to write a program fell dramatically.

What a FORTRAN program looked like

Early FORTRAN programs were written on punched cards, with a rigid format: columns 1 to 5 for numeric labels, column 6 to mark the continuation of a line, the code from column 7 to 72. Here is an example in the style of the classic versions, which calculates the sum of the squares of the first ten numbers:

      ISUM = 0
      DO 10 I = 1, 10
      ISUM = ISUM + I*I
   10 CONTINUE
      PRINT *, ISUM
      END

A few features stand out:

  • the DO loop names the label of the statement that closes the loop;
  • variables were not declared: by convention, those starting with I to N were integers, the others real;
  • everything was in upper case, because the card punches of the time had no lower-case letters.

The convention on variable initials left behind a habit that still survives: using i, j, k as names for loop counters.

The evolution of the language

FORTRAN spread rapidly through scientific computing centres and was soon ported to computers from other manufacturers. The main versions tell the story of how programming evolved:

Version Main new features
FORTRAN (1957) Expressions, DO loops, arrays
FORTRAN II (1958) Separately compiled subroutines
FORTRAN 66 First programming language with an official American standard
FORTRAN 77 Structured IF-THEN-ELSE construct, character strings
Fortran 90 Free form, modules, whole-array operations

With Fortran 90 the name began to be written with only the initial capitalised, and the language adopted modern constructs. Later revisions added object-oriented programming and support for parallel computing.

Why it is still used

Fortran is still used today in high-performance scientific computing: climate models, fluid dynamics, computational physics. The reasons are concrete. There are huge numerical libraries tested over decades, and the language is designed to allow compilers to perform aggressive optimisations on array operations. Many linear algebra libraries used indirectly even by modern languages originated in the Fortran world.

John Backus after FORTRAN

Backus made another fundamental contribution by taking part in the definition of ALGOL. To describe the syntax of that language he proposed a formal notation, later refined by Peter Naur and known as Backus-Naur form (BNF). The grammars of programming languages and many data formats are still described today with variants of this notation.

In 1977 Backus received the Turing Award. In the lecture that accompanied the award he surprisingly criticised the very imperative programming style that FORTRAN had made popular, proposing a functional approach.

The lesson of FORTRAN

The story of FORTRAN contains a principle that still holds: an abstraction is adopted only if its cost is acceptable. High-level languages prevailed not because they were more elegant, but because Backus's compiler showed that convenience did not have to be paid for with slowness.

In short

  • FORTRAN was proposed by John Backus at IBM at the end of 1953, and the first compiler was delivered for the IBM 704 in 1957.
  • Its optimising compiler showed that automatically generated code could compete with hand-written code.
  • FORTRAN 66 was the first language with an official American standard; Fortran 90 introduced free form and modules.
  • Backus also contributed BNF notation and received the Turing Award in 1977.
MM
Marco Marzaduri

Marco Marzaduri works in cybersecurity, digital forensics and web development. With degrees in computer science and psychology, he combines technical analysis with an understanding of the human factor.

Read also