There are a number of names that most people associate with the momentous 1969 Moon landing — Neil Armstrong, Buzz Aldrin, even Stanley Kubrick for dedicated conspiracy theorists — but Margaret Hamilton is not usually among them. Yet this pioneering woman was the lead developer for Apollo's flight software in the days when working mothers were rare — let alone female computer scientists.
Hamilton earned her BA in Mathematics from Earlham College in 1958, going on to teach high school mathematics and French briefly to support her husband as he earned his undergraduate degree. During this time, in 1960, she took an interim position at MIT, working at Marvin Minsky's Project MAC. It was meant to be a temporary position while her husband studied, developing software for predicting weather with MIT's LGP-30 and PDP-1 computers in the meteorology department.
After he graduated it was supposed to be her turn to be the student again, with a plan to go back for graduate study in abstract mathematics at Brandeis University. At that time software engineering and even computer science were not classes you could take at university — let alone entire degrees — instead they were skills that were largely learned by graduates of disciplines like maths and science while on the job.
Programming At MIT
In 1961, Hamilton moved on to working on the SAGE Project at MIT's Lincoln Labs, writing software that would search for "unfriendly" aircraft during the Cold War, when such concerns were paramount. Hamilton described her early time at Lincoln:
What they used to do when you came into this organization as a beginner, was to assign you this program which nobody was able to ever figure out or get to run. When I was the beginner they gave it to me as well. And what had happened was it was tricky programming, and the person who wrote it took delight in the fact that all of his comments were in Greek and Latin. So I was assigned this program and I actually got it to work. It even printed out its answers in Latin and Greek. I was the first one to get it to work.
By the time the Apollo Space Program came along, it was clear that Hamilton wouldn't be going back to university for her postgrad study after all. Her work on the SAGE project had left her highly recommended for the role of lead programmer on Apollo, when she moved to the Charles Stark Draper Laboratory at MIT. Her team at NASA was responsible for developing Apollo's on-board guidance software, at a time when software was only just emerging as a new concept in the field of computer science.
The process that coding entailed at that early point was fascinating. For Hamilton and her team, programming still consisted of punching holes in cards to execute certain processes. These cards came with difficulties of their own — often one of the programmers would write code that told the computer to advance by a certain number of cards, but if cards in between were added or taken away, the number would be wrong. As TIME reports, Hamilton knew that these kinds of problems were unavoidable, but she overcame these difficulties with a dedication to rigorous testing.
The punched card programs would be run through a giant Honeywell mainframe computer that would simulate the Apollo lander, making sure everything functioned as planned. It obviously wasn't practical for NASA to actually run the systems up to the Moon for testing purposes, so they ran as many tests on the ground as they needed to make sure the software would work. "We had to simulate everything before it flew," Hamilton told Wired last year.
After testing, the code was literally hard-wired to be run on Apollo's computers. It would be sent off to a team of seamstresses at a nearby factory (lovingly nicknamed "Little Old Ladies" by the folks at Apollo), where they would manually create the code by threading copper wire through magnetic rings. A wire threaded through the core was a 1, while a wire going around the core was a 0. This meant the code was almost indestructible, but also very hard to modify if the need came up.
A Crisis Averted
Many of the foundations of contemporary software designs were ones that Hamilton developed by working on Apollo, including asynchronous software, human-in-the-loop decision capability and priority scheduling — the last of which proved invaluable at a crucial point in the Apollo 11 Moon landing mission. On 20 July 1969, after the Lunar Module Eagle had separated from Command Module Columbia, the Moon landing was very nearly aborted because of unexpected error messages popping up from the guidance computer.
As it turned out, Hamilton had done her job well and these error messages only meant that the software was doing its job as planned. The computer was being overwhelmed by a series of erroneous calculations at a vital moment when it needed to be landing the module, but thanks to its programming it was able to prioritise the most important job, leaving the less vital processes until later. Hamilton discusses the moment in a letter simply titled "Computer Got Loaded" from 1971:
Due to an error in the checklist manual, the rendezvous radar switch was placed in the wrong position. This caused it to send erroneous signals to the computer. The result was that the computer was being asked to perform all of its normal functions for landing while receiving an extra load of spurious data which used up 15% of its time. The computer (or rather the software in it) was smart enough to recognize that it was being asked to perform more tasks than it should be performing. It then sent out an alarm, which meant to the astronaut, I'm overloaded with more tasks than I should be doing at this time and I'm going to keep only the more important tasks; i.e., the ones needed for landing.
Actually, the computer was programmed to do more than recognize error conditions. A complete set of recovery programs was incorporated into the software. The software's action, in this case, was to eliminate lower priority tasks and re-establish the more important ones ... If the computer hadn't recognized this problem and taken recovery action, I doubt if Apollo 11 would have been the successful moon landing it was.
'One Of The Guys'
Hamilton has said she was always so wrapped up in her work that she never noticed the gender imbalances in the world of early computer science — with such a passion for her work and an in-depth knowledge of the processes that she was always just "one of the guys". "On hindsight, some of the things that were accepted back then, because we (men and woman) did not know any better, are not accepted now; and they often seem quaint and even astounding when looking back," Hamilton recalls in an interview with Medium. "We still do other things out of ignorance today, such as continuing to pay women lower salaries than men."
She was an anomaly in that space and that time, however, and as a working mother she would even bring her daughter Lauren into the lab with her on weekends and evenings. "People used to say to me, 'How can you leave your daughter? How can you do this?'" she recounted to Wired, but she never let the realities of being a working mother in the '60s get in the way of a pioneering career.
By the time the Apollo project was in full swing, the importance of software to the space race was paramount — where only a few years earlier it hadn't even been mentioned in the brief. By 1969, more than 400 people worked on the Apollo's software, furthering an industry that would change not only their voyage to the Moon but also become a $400 billion industry that would soon change the world.
After Apollo, Hamilton also worked on Skylab — the United States' first space station — and some of the preliminary system software requirements for the Space Shuttle's flight software, though by the '70s she had left NASA for a company she co-founded called Higher Order Software. In 1986 she founded her own company called Hamilton Technologies, developed around the Universal Systems Language, that aimed to accelerate the technology that was swiftly taking over the world and introduce it to even more of the population.
Back in 2014, a photo of Hamilton with the listings for Apollo 11's source code piled up beside her went viral, introducing a little known figure in the history of computing back into the world — through their computers, of course. She has also received a number of official awards and accolades, including the Augusta Ada Lovelace Award for Women in Computing and the NASA Exceptional Space Act Award for scientific and technical contributions. She did not, however, expect her photo and her story to go viral the way it did. In a subsequent interview with Medium, she only sounded surprised, though appreciative. "My generation does not use these social media," she explained, but qualified: "It is always great when people take interest in your work."
These Are Your Numbers is a new Lifehacker series where we profile great minds that have made significant contributions to robotics and computing.