Margaret Hamilton
Margaret Hamilton

CAMBRIDGE, Mass. — Margaret Hamilton, the mathematician who led the team that wrote the onboard software for the Apollo flights, died Sept. 30. She was 90.

She died in a hospital in Cambridge, her daughter, Lauren Hamilton, told The New York Times. The Massachusetts Institute of Technology, where she worked from 1959 to the mid-1970s, confirmed the death. She is survived by her daughter, her son-in-law Richard Selesnick, two grandsons, four great-grandchildren, and her siblings John, David and Kathryn.

Hamilton was the first woman hired as a programmer on the Apollo project at MIT's Instrumentation Laboratory, in 1965. She rose to director of the Software Engineering Division and led a team of about 100 people writing and testing the in-flight code. The lab built two 70-pound computers for each mission, one in the command module and one in the lunar module. The lunar-module software was what Neil Armstrong and Buzz Aldrin flew to the surface on July 20, 1969. She is credited with putting the phrase "software engineering" into use, to put the code on the same footing as the hardware.

"Looking back, we were the luckiest people in the world," she said of those years. "There was no choice but to be pioneers." MIT's notice said the same thing from the other side. "To say Hamilton was a pioneer — to say she was ahead of her time — would be a dramatic understatement." A colleague's tribute released with the notice said she "personified leadership by example, and established a practice of software engineering based on problem-solving and systems engineering that we all benefit from."

She had come to the lab as a young mathematician, working while her husband was in law school. When she heard MIT was designing the flight computers, she asked to join. She brought her young daughter to the lab on nights and weekends. One of the published accounts of the landing credits the software's priority system with keeping the lunar module flying when the guidance computer flashed overload alarms in the final minutes. The code dropped lower-priority tasks and kept the landing routines. Armstrong landed. The alarms became the story she was asked to tell for the rest of her life.

President Barack Obama awarded her the Presidential Medal of Freedom in 2016. She wrote more than 130 papers, left MIT in the mid-1970s, and ran her own software company. The photograph that followed her was the one NASA took in 1969: Hamilton standing beside a stack of printed Apollo code as tall as she was.

The stack was the job. The landing was the test. She was 90 when she died, 57 years after she was hired to write a program that had to work the first time, with two men in the machine and no second draft.