Tech●●●●●Difficulty 2 of 5

How did Grace Hopper's compiler teach computers to read words?

Hopper was told computers could not understand English, so she built a program that translates it before the machine ever runs.

▶ Start the story

A compiler is a program that translates code written in one programming language into another, usually from a high-level language people can read into the a processor runs. Grace Hopper believed programming should be simplified with an English-based language, translated into machine code by a secondary program she called a compiler. She was told very quickly that it couldn't be done, because computers didn't understand English. But the computer never has to understand English: the translator does the understanding once, ahead of time, and the machine only ever sees its own instructions.

Her first system, A-0, written in 1952, looked quite different from a modern compiler. A program was a list of numbered with their arguments written after them, and A-0 converted that list into , which was then fed into the computer a second time to run. It functioned more as a , though Hopper's team coined the word compiler to describe it. The words came next: Hopper went on to lead the release of compiled languages such as FLOW-MATIC, and in 1959 helped create COBOL, a language based on English words. The first unambiguously complete compiler came in 1957, from John Backus's team at IBM, for FORTRAN.

Backus liked to say that much of his work came from being lazy. He didn't like writing programs, so he built a system to make writing them easier. His compiler produced code efficient enough that programmers working in assembly language accepted a high-level replacement, and by 1963 more than 40 FORTRAN compilers existed for different machines.

From A-0 to a world of compilers
  1. 1952

    Hopper's team writes the compiler for A-0

  2. 1957

    IBM's FORTRAN compiler, the first unambiguously complete one

  3. 1963

    Over 40 FORTRAN compilers exist

Inside, a compiler works in phases, such as checking the words and grammar, converting the program into an intermediate form, optimizing it, and generating code for a specific chip. That is how readable code becomes the tiny machine instructions a processor runs.

Quiz me

0/3

  1. 1.Why could Hopper's idea work even though computers didn't understand English?
  2. 2.Why is A-0 not usually called a full modern compiler?
  3. 3.What is the benefit of splitting a compiler into front end, middle and back end?

Recap

A compiler translates the whole program ahead of time, in phases, so the machine only ever sees instructions it understands.

💡 A trick to remember it · A compiler is a translator who finishes the whole book before you start reading.

Surprising fact · John Backus said much of his work, including the first FORTRAN compiler, came from being lazy.

Sources (4)

No source, no claim. Every fact in this lesson (14 claims) cites at least one of these.

  1. [1]Compiler · Wikipedia
  2. [2]Grace Hopper · Wikipedia
  3. [3]A-0 System · Wikipedia
  4. [4]Fortran · Wikipedia
More lessons in 💻 Tech (3) See all tech lessons →

One more light on your map.

Get one lesson like this every day, about the things you love. Free, in two or five minutes.

Get the share card for this lesson ↗