I love this picture of Margaret Hamilton standing next to the navigation code responsible for NASA's Apollo mission, but I'd like more context. What language was it written in? What did it "do?" How was Hamilton's contribution viewed at the time?

by mowshowitz

I think this picture is so great, but looking at it recently, I realized I only know the most general strokes about the story surrounding it and very few details. It raises so many questions for me. For example:

  • The code in those books. I don't know what software design was like at the time--was it written in a particular language? What was the code responsible for? "Navigation" seems so broad. Did it react to certain inputs? Was it just a sequence to time thrusters with hard-coded calculations?
  • Hamilton's stature. Was she considered a central element of the Apollo mission or a peripheral one? Did the fact that she was a woman seem remarkable at the time? Did her NASA-related work end up influencing software design? If so, how so?

Thanks so much in advance!

justfiddling

So, I can answer Question 1 in part:

The source code was written in assembly language. Assembly language is a not actually a single programming language in the way that say, Java or Python. It's a type of language: the lowest-level language you can get in human-readable form, and it is converted ("assembled") directly to machine code (the sequence of 0s and 1s that the computer actually works with.

As such, broadly speaking, each instruction in assembly can be converted directly to a machine instruction, and assembly language therefore is specific to a given computer architecture. So the flavor of assembly used in the Apollo Guidance Computer (AGC) was specific to that computer architecture

You can actually view the code that Hamilton is posing next to online! It has been scanned, cleaned up and uploaded to Github here. Here's an example of what a chunk of AGC assembly looked like. Everything including and after the pound symbol is a comment for the reader, not code:

PROG21		CAF	ONE
	TS	OPTION2		# ASSUMED VEHICLE IS LM, R2 = 00001
	CAF	BIT2		#  OPTION 2
	TC	BANKCALL
	CADR	GOPERF4
	TC	GOTOP00H	# TERMINATE
	TC	+2		# PROCEED VALUE OF ASSUMED VEHICLE OK
	TC	-5		# R2 LOADED THROUGH DSKY

In a general sense, all code does nothing more than "react to certain inputs" but no, it was "not just a sequence to time thrusters with hard-coded calculations". Astronauts needed to be able to react and respond to changing and unexpected conditions.

As a software developer, what she and her colleagues did is remarkable. Working with constraints that most programmers would find extraordinary today (they had incredibly little memory to work with), they built software that did something absolutely incredible. Very few humans program at this low a level (meaning this close to the actual machine code) these days; assembly language is generally written by computers that compile human-written code in higher-level languages to assembly that can then be assembled to machine code.

Modern programming languages take advantage of decades of development since Hamilton's day; modern languages are much more human-readable, they feel much more like English, as it were, than the code above. They have numerous features built-in that didn't exist then. Modern developers have access to much more robust debugging tools. It goes on and on. Even if you're not a programmer spending a few minutes perusing the GitHub archive I linked to above can be a worthwhile experience, if only to try to start to appreciate the magnitude of the feat.

jeffbell

Since no one has addressed part two. From the picture I would estimate her stature at about 9000 pages .... But seriously.....

She played a significant role not only at NASA in the Apollo program, but was an early participant in the founding of the field of software engineering.

She entered the industry at an important turning point in computer programming. Some her first work was on the SAGE air defense system which was last of the tube powered computers, and then worked with the PDP-1, one of the first using transistors. At the same time the capacity of the machines was growing to the point where it became harder and harder for one person to keep track of the organization of the whole program in their head, leading to what was being called the "software crisis" of the mid sixties.

This is where the field of Software Engineering is born, and she was starting with a blank slate. Computer Science is to Software Engineering maybe like Chemistry is to Laboratory Techniques. In this case it is the engineering discipline of collecting functional requirements of the system, dividing the tasks into smaller units, describing the interfaces and dependencies between the parts, and testing that the requirements are met. On complex systems you have to set up a process to ensure that changes in one portion of the program don't break the functionality in another part. The Apollo software was particularly tricky because it had to operate with high reliability under real-time conditions.

Hamilton did this work at the Instrumentation Lab, which was an MIT owned research lab near campus that developed inertial guidance systems for airplanes, missiles, and submarines. In 1973 the anti-war feeling on campus persuaded MIT to spin it off as the slightly more independent Draper Labs.

By the time of the Apollo flights, Hamilton was head of software development at the lab. You don't get to this position without both technical mastery and the ability to look at the big picture. I'm not sure that she was "central" at NASA, but she was certainly central to the IL.

On top of this she did a lot of thinking about what was important in software engineering. Even though she was not in an academic job, she is still credited with 130 publications.

You asked about women in computer science and the answer is the opposite of what you might have expected. In the late 60s, the gender ratio for computer science grads was about 14%. It climbed to 37% in the early 80's but strangely has drifted downward to near 20% today. (It's sometimes hard to count, since many arrive in the field via a degree in math or stats). This drop appears to be related with the marketing of personal computers towards boys, but this is beyond my expertise.