FREE HISTORICAL FIGURES OF COMPUTING PROFILE

Grace Hopper

1906–1992 · Computer scientist and naval officer

Grace Hopper

Mathematician, programmer, and naval officer, 1906–1992. Study focus: automatic program construction, business data, and portability contracts.

Hopper helped make programming less dependent on hand-assembled machine instructions. Her work on routine libraries, A-0, FLOW-MATIC, and language standardization addressed different layers of that problem. Calling all of them “the first compiler” conceals the mechanisms students need to understand.

Historical setting

Hopper graduated from Vassar in 1928 and completed a mathematics doctorate at Yale in 1934. She taught at Vassar before joining the wartime Naval Reserve and working on Harvard's Mark I computing project. In 1949 she joined the Eckert-Mauchly organization, where UNIVAC programming created opportunities for automatic-programming systems. Her later Navy work included programming-language standardization and validation. Yale biography

A-0, associated with 1952, selected and combined previously prepared routines. The historical word compiler described that collection process. It was not already a modern parser, type checker, optimizer, and code generator for English sentences. FLOW-MATIC later supported business-oriented symbolic statements and records. COBOL emerged from collaborative design and standardization drawing on several predecessors, including FLOW-MATIC. Hopper's oral history discusses this organizational and programming context. 1980 interview, Knuth's historical account

Reuse was not invented once, and modern package managers are not simply renamed A-2. They solve additional problems involving versions, dependencies, distribution, and trust. A precise history can recognize Hopper's contribution without claiming that every later translator descends from it.

Worked mechanism: assemble a routine library

Imagine an original teaching system with two prewritten routines. READ occupies 12 instruction words and TOTAL occupies 18. The main program occupies addresses 100–109. Place READ at 110–121 and TOTAL at 122–139. A symbolic call to TOTAL must become a transfer to address 122.

Suppose an instruction inside TOTAL, at relative offset 4, transfers to relative offset 9. In this simple relocation model its location becomes 126 and its target becomes 131. A relocation record identifies which word contains an address that must be adjusted. The system must not add 122 to every numeric constant: a literal tax rate or loop count is not a memory address.

Now add an eight-word routine before TOTAL. Its base changes from 122 to 130, so the relative target 9 becomes 139. If the linker copies machine words without applying relocation, the old branch goes to the wrong place. Routine reuse requires an interface and relocation discipline, not merely a folder of code.

These invented addresses illustrate selection, placement, and relocation; they are not a reconstruction of A-0's exact data format. They make the distinction between assembling existing machine routines and translating a structured source language concrete.

Translating an expression is a separate job

Consider the source expression gross - rate * gross. A language with multiplication precedence parses it as gross - (rate * gross). A toy compiler could emit the following stack-machine pseudocode:

PUSH gross
PUSH rate
PUSH gross
MULTIPLY
SUBTRACT

MULTIPLY replaces the top two values by their product. SUBTRACT replaces the next-to-top value minus the top value by the result. With gross=100 and rate=0.2, the stacks become [100], [100,0.2], [100,0.2,100], [100,20], then [80].

This translation requires a grammar, an interpretation of names, arithmetic rules, and a target execution model. A compiler can also target another language or intermediate representation rather than native machine code. English-looking keywords do not eliminate formal syntax or make an ambiguous business requirement precise.

For financial records, arithmetic representation matters. If a field stores integer cents, 10005 represents 100.05 units of currency. Computing a 7% charge gives 700.35 cents before rounding. Whether the result becomes 700 or 701 depends on the specified rounding rule. A source program can be readable and still wrong if those semantics are omitted. The FLOW-MATIC manual's attention to records and processing operations is a reminder that business languages address data organization as well as formulas. 1958 manual

Portability is an agreement, not a promise without conditions

A language standard specifies what conforming constructs mean. An implementation maps those constructs to a particular machine and runtime. A validation suite checks selected behaviors. Passing tests does not prove every program will behave identically in every environment.

Consider a constructed payroll program that assumes an eight-character employee identifier, a particular character encoding, a local file path, and a decimal rounding mode. Compiling it on a second machine preserves behavior only if those assumptions are met or explicitly adapted. Source-level portability, binary compatibility, and equivalent external services are distinct properties.

A good portability test includes boundary values, empty files, maximum field widths, negative adjustments, and rounding cases. It also checks file formats and error behavior. Hopper's work on validation belongs in this practical context. It did not make every COBOL program automatically portable across any computer. Yale account of standardization

Evidence instead of a mascot story

The Smithsonian preserves a Mark II logbook containing a moth and a joke about finding a literal bug. Technical use of bug predates that event. Hopper and colleagues helped popularize the story, but the artifact does not establish that she personally discovered the insect or coined the term. The museum is explicit about the uncertainty of logbook ownership. Smithsonian artifact record

The useful educational lesson is that errors can occur at several layers. A physical relay fault, a bad address relocation, an incorrect parse, and an unspecified rounding policy all produce wrong results through different mechanisms. Effective diagnosis starts by locating the layer and constructing a reproducible case.

Exercises

  1. A routine begins at address 500. At offset 6 it contains a branch to offset 14 and at offset 7 the literal constant 14. After relocating the routine to address 900, what changes? Explain how a relocation table distinguishes the two uses of 14.
  2. Translate (gross-rate)*gross into the same stack pseudocode and trace it for gross=100, rate=0.2. Compare with the unparenthesized expression in the lesson. What stage must preserve the difference?
  3. A compiler passes 10,000 conformance tests. A program still gives a different payroll total on another system. Give three concrete assumptions to investigate and explain why neither compiler failure nor programmer error follows immediately from the observation.
Compare your reasoning with the worked solutions
  1. The branch instruction moves from address 506 to 906. Its target changes from 514 to 914. The literal constant remains 14. A relocation table identifies the address-bearing field, so the loader adjusts only that field. Blindly adding 400 to every occurrence of the number 14 would corrupt data while failing to capture the semantic distinction between a value and an address.
  2. Emit PUSH gross; PUSH rate; SUBTRACT; PUSH gross; MULTIPLY. The intermediate subtraction yields 99.8, then multiplication yields 9980 under exact decimal arithmetic. The original expression yielded 80. Parsing must preserve the parentheses in the syntax tree; later optimization and code generation must preserve the resulting semantics. Readable names do not compensate for an incorrect parse.
  3. Investigate decimal precision and rounding, input record layout and character encoding, and external file/service behavior. A test suite samples specified language behavior; it may not cover this program or environment. The program may rely on implementation-defined behavior, an extension, or a different dataset. First compare the specification, actual inputs, and a minimal reproducer. Only then can the discrepancy be assigned to a compiler defect, a program defect, or a documented difference.