SPEAKER_00: Amazing, fascinating stories of inventions, ideas and innovations. Yes, this is the podcast about the things that have helped to shape our lives. Podcasts from the BBC World Service are supported by advertising.
SPEAKER_01: 50 Things That Made The Modern Economy, with Tim Harford.
SPEAKER_02: One, zero, zero, zero, zero, one, zero, one, zero. That's the language of computers. Every clever thing your computer does, make a call, search a database, play a game, comes down to zeros and ones. Actually, that's not quite true. It comes down to the presence or absence
SPEAKER_02: of a current in tiny transistors on a semiconductor chip. The zero or one merely denotes if the current is off or on. Thankfully, we don't have to program computers in zeros and ones. Imagine how difficult that would be. Microsoft Windows, for example, takes up 20 gigabytes of space on my hard drive. That's 170 billion zeros and ones. Print them out and the stack of A4 paper would be four kilometres high. Now imagine you had to work through those pages, setting every transistor manually. Well, ignore how fiddly this would be. Transistors measure just billionths of a metre. If it took a second to flip each switch, installing Windows would take 5,000 years. Early computers really did have to be programmed rather like this. Consider the Automatic Sequence Controlled Calculator, later known as the Harvard Mark I.
SPEAKER_04: A triumph of mathematical and mechanical skill is this great new automatic calculator at Harvard.
SPEAKER_02: It was a 15 metre long, two and a half metre high concatenation of wheels and shafts and gears and switches. It contained 530 miles of wires. It whirred away under instruction from a roll of perforated paper tape. If you wanted it to solve a new equation, you had to work out which switches should be on or off, which wires should be plugged in where.
SPEAKER_03: Designed to expedite all forms of mathematical and scientific research.
SPEAKER_02: Then you had to flip all the switches, plug all the wires and punch all the holes in the paper tape. Programming it was a challenge to stretch the mind of a mathematical genius. Four decades on from the Harvard Mark I, more compact and user friendly machines like the Commodore 64 were finding their way into schools. If you're around my age, early 40s, you may remember the childhood thrill of typing this.
SPEAKER_04: Ten, print, Hello World. Twenty, go to ten.
SPEAKER_02: And low. Hello World would fill the screen. You'd instructed the computer in words that were recognisably, intuitively human and the computer had understood. It seemed like a minor miracle. If you ask why computers have progressed so much since the Mark I, one reason is certainly the ever tinier components. But it's also unthinkable that computers could do what they do if programmers couldn't write software like Windows in human-like language and have it translated into the ones and zeros, the currents or not currents that ultimately do the work. The thing that began to make that possible was called a compiler. And the story of the compiler starts with a woman called Grace Hopper. In 1906, when Grace was born, not many people cared about gender equality in the jobs market. Fortunately for Grace, among those who did was her father, a life insurance executive. He didn't see why his daughter should get less of an education than his son. Grace went to a good school and turned out to be brilliant at maths. Her grandfather was a rear admiral and her childhood dream was to join the navy, but girls weren't allowed. She settled for becoming a professor instead. Then in 1941, the attack on Pearl Harbour dragged America into the Second World War. Male talent was called away. The navy started taking women. Grace signed up at once. If you're wondering what use the navy had for mathematicians, consider aiming a missile. At what angle and direction should you fire? The answer depends on many things. How far away is the target? What's the temperature? The humidity? The speed and direction of the wind? The calculations involved aren't complex, but they were time-consuming for a human computer. That's the word for someone with a pen and paper. Perhaps there was a faster way. As Hopper graduated Midshipmen's School in 1944, the navy was intrigued by the potential of an unwieldy contraption recently devised by Howard Aiken, a professor at Harvard. It was the Harvard Mark I. The navy sent Hopper to help Aiken work out what it could do. Aiken wasn't thrilled to have a female join the team, but soon Hopper impressed him enough that he asked her to write the operating manual. Figuring out what it should say involved plenty of trial and error. More often than not, the Mark I would grind to a halt soon after starting, and there was no user-friendly error message. Hopper and her colleagues started filling notebooks with bits of tried and tested reusable code. By 1951, computers had advanced enough to store these chunks, they were called subroutines, in their own memory systems. Hopper was then working for a company called Remington Rand. She tried to sell her employer on letting programmers call up these subroutines in familiar words, to say things like subtract income tax from pay, instead of, as Hopper put it, trying to write that in octal code or using all kinds of symbols. Hopper later claimed that no one thought of that earlier because they weren't as lazy as I was. That's tongue in cheek self-deprecation, but it does have a kernel of truth. The idea Hopper called a compiler involved a trade-off. It made programming quicker, but the resulting programs ran more slowly. And that's why Remington Rand weren't interested. Every customer had their own, bespoke requirements for their shiny new computing machine. It made sense, they thought, for the company's experts to program them as efficiently as they could. Hopper wasn't discouraged, she simply wrote the first compiler in her spare time. And others loved how it helped them to think more clearly. One impressed customer was an engineer called Karl Hammer, who used it to attack an equation his colleagues had struggled with for months. Hammer wrote 20 lines of code and solved it in a day. Like-minded programmers all over the US started sending Hopper new chunks of code. She added them to the library for the next release. In effect, she was single-handedly pioneering open source software. Grace Hopper's compiler evolved into one of the first programming languages, COBOL. More fundamentally, it paved the way for the now familiar distinction between hardware and software. With one of a kinds like the Harvard Mark I, software was hardware. There was no pattern of switches that would work on some other machine because other machines would be wired completely differently. But if a computer can run a compiler, it can also run any program that uses it. More and more layers of abstraction have since come to separate human programmers from the nitty-gritty of physical chips. And each one has taken a further step in the direction Grace Hopper realized made sense, freeing up programmer brain power to think about concepts and algorithms, not switches and wires. Hopper had her own views of why colleagues resisted the compiler at first. And it wasn't because they cared about making programs run more quickly. No, they enjoyed the prestige of being the only ones who could communicate with a godlike computer on behalf of the mere mortal who'd just purchased it. The high priests, Hopper called them. Hopper thought anyone should be able to program, and now anyone can. And computers are far more useful because of that. One of our key sources was Grace Hopper and
SPEAKER_01: the Invention of the Information Age by Kurt W. Beyer. For a full list of our sources, please see bbcworldservice.com slash 50things.