Hacker News new | past | comments | ask | show | jobs | submit login
A Glimpse into the Apollo Guidance Computer (medium.com/borja)
114 points by bradddd on July 11, 2016 | hide | past | favorite | 26 comments



Included near the bottom of the article is a link to a Spanish outlet's interview with Margaret Hamilton (the lead flight software engineer) that I had only recently discovered:

https://medium.com/@verne/margaret-hamilton-the-engineer-who...

She gives some general insight to how the code works, but the biggest highlight for me was how she apparently coined the term "software engineering":

> Software during the early days of this project was treated like a stepchild and not taken as seriously as other engineering disciplines, such as hardware engineering; and it was regarded as an art and as magic, not a science. I had always believed that both art and science were involved in its creation, but at that time most thought otherwise. Knowing this, I fought to bring the software legitimacy so that it (and those building it) would be given its due respect and thus I began to use the term “software engineering” to distinguish it from hardware and other kinds of engineering; yet, treat each type of engineering as part of the overall systems engineering process. When I first started using this phrase, it was considered to be quite amusing. It was an ongoing joke for a long time. They liked to kid me about my radical ideas. Software eventually and necessarily gained the same respect as any other discipline.

Apparently, she's kept off of the social network grid, but would love if someone could convince her to do an AMA.


Do you think in the male dominated world of engineering in the middle part of the 20th century that they considering programming to not be a serious discipline in engineering lead to women being hired in positions they would not have if programming carried higher prestige? If so what does this tell us about the contributions made by women like Margaret Hamilton, Grace Hopper, and the ENIAC programmers? The issue of men dominating software engineering today isn't about talent or potential, but likely grounded in sexism. If you consider hiring women you double your potential labor pool.

(If you are going to down vote this comment, can you please take a moment to explain why?)


Yes, it was considered to be something like secretarial work. It took a long time for there to be a real appreciation for what programming was going to be like.

The contributions of Hamilton and Hopper during that era suggests to me that when things are new, they are undervalued, and that undervalued professions and undervalued people have a way of finding each other and doing great things.


Absolutely they considered programming to be not as serious. There's a great book called Digital Apollo by David Mindell[1] that talks about the creation of the Apollo Guidance Computer.

One of the stories is of a male manager who, after being put in charge of a team of software developers, asks his wife not to tell any of their friends he was managing a software team.

[1] https://www.amazon.com/Digital-Apollo-Human-Machine-Spacefli...


Actually, it was his wife who asked him (as a joke).


I think the primary reason may have been that before the advent of stored-program digital computers, vast arrays of people with mechanical calculators were used for computational tasks. When the first digital computers came, the job was still sufficiently easy that the skills were easily transferable - the first electronic digital machines were glorified calculators. Everyone thought that making programs would be trivial so "clerical" people were used. Only when the complexity of software started increasing the scale of the problem became apparent, and a new field was born. And the newly-trained young people who came into a booming field came with a different demographics. The job description changed significantly, it's not (only!) that the same job was suddenly usurped by male applicants.


> (If you are going to down vote this comment, can you please take a moment to explain why?)

Generally, any comment or story on HN that suggests the presence of sexism in the world of software gets downvoted/flagged. Your account is almost a year old so I'm surprised you didn't know this. :)


During the same period in time that women dominated the programming profession, men dominated the teacher profession. Now those two professions has switched places.

Should we just say that all the sexist women went to the teacher profession and pushed out the men, and all the sexist men went to the programming profession and pushed out the women? One thing seem for sure, only recruiting from half the population seem to cause a problem for both the teacher and programming profession.


You know it might be that being a good programmer is not necessarily moored to sex.


There was a whole conference dealing with the same topic at about the same time, organized by the military (http://homepages.cs.ncl.ac.uk/brian.randell/NATO/NATOReports...) and attended by dozens of people from many institutions. Clearly, it had already been considered a problem by then. Also remember that the mid-1960s were when the OS/360 effort took place, inspiring Fred Brooks' famous book.


Here's the company she ran afterward. Most of her time went into 001 Toolkit.

http://htius.com


To address the limited instruction set, the AGC team wrote a software virtual machine (or p-code machine) for the AGC to interpret an entirely new instruction set called the “interpretive language”.

Interestingly, Steve Wozniak would come up with a similar solution for the Apple II about a decade later:

https://en.m.wikipedia.org/wiki/SWEET16

SWEET16 is an interpreted byte-code language invented by Steve Wozniak and implemented as part of the Integer BASIC ROM in the Apple II series of computers. It was created because Wozniak needed to manipulate 16-bit pointer data in his implementation of BASIC, and the Apple II was an 8-bit computer.


Short Code was an interpreted bytecode proposed by Mauchly in 1949 and implemented by Schmitt on the UNIVAC I in 1950:

https://en.wikipedia.org/wiki/Short_Code_%28computer_languag...

Going back further, Turing's 1936 Universal Machine is "universal" because it can interpret a description of another machine, which could be a different Universal Machine (i.e. an interpreter), an application-specific machine, or even the same universal machine (i.e. self-emulation).

Gates and Allen developed Altair BASIC on a PDP-10 at Harvard in 1976, handling invalid-instruction traps by emulating the 8080 instructions they were using, thus turning the PDP-10's operating system into an interpreter for a different instruction set.

The Alto being used at the same time at Xerox PARC was optimized for such emulations: it ran "microcode" loaded from RAM, so that you could program it to interpret whatever instruction set was most appropriate for your application.

Throughout the 1960s and 1970s, a large fraction of IBM computer time was spent running emulators of earlier IBM models like the 650, 704, 709, and 7090, in order to run the software developed for those older machines.

And of course today much of our computer time is spent running software represented as JVM bytecodes, SpiderMonkey bytecodes https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Sp..., CPython bytecodes, or Lua "bytecodes"; and Vulkan, the new replacement for OpenGL, defines a vendor-independent bytecode format for representing GPU programs.

A level below this, the currently popular out-of-order CPUs recompile the i386 or amd64 instructions emitted by our compilers into sets of "micro-ops", which are then independently scheduled; sometimes these micro-op representations are cached so that the recompilation process doesn't have to be repeated every time through a loop. You could argue that this, even more than the usual microcode approach that was supposed to go out the window with the advent of RISC, has turned our entire software infrastructure into bytecode for a more convenient virtual machine.

Your comment seems to be predicated on the misconception that programming a computer to interpret a more convenient instruction set is some kind of bizarre or unusual thing to do. In fact, it is not only commonplace, but absolutely central to our modern concept of "computer".


Your last paragraph seems unfair to the comment you're responding to. I too was reminded of SWEET16: they're similar in being very simple interpreted VMs meant to be hand-coded to squeeze code size in tiny computers. They're also invoked in about the same way, to be mixed into native assembly code.

If my dim memory of Knuth's article on the early history of compilers is right, Short Code was meant more for programmer productivity than code size.


> and Vulkan, the new replacement for OpenGL, defines a vendor-independent bytecode format for representing GPU programs.

Vulcan's SPIR-V, however, is more like a compiler's intermediate format than an ISA to be interpreted by either a program or hardware. It's probably more similar to AS/400's TIMI encoding in how it's supposed to work.

(Also, the mention of SWEET16 and the way of making parts of low-level programs more palatable reminded of the invention of Forth in late 1950s/early 1960s as well.)


Interesting fact: the listings contain comments indicating page numbers in the form of "# Page [number]". To find the maximum page number, I ran the following one-liner:

    $ awk '/# Page / { print $3 }' Apollo-11/*.s | sort -gr | head -1
    1516
It is often speculated that in the famous photo, Margaret Hamilton is standing next to the pile of the complete source code. However, 1516 pages are far from such a high pile. I wonder, aren't these books just containing different revisions of the code, or maybe not all of the code has been published?


Apparently the AGC only had 36,864 words of rom. Looking at a random file from the github repo, each page seems to contain 50 lines. So if you put one instruction (one word) per line you could fit the whole rom inside 738 pages (assuming there's no optimization during assembly). Add some space for the comments and blank lines, and 1516 seems about right.

In any case it's doubtful a single program spanning the whole pile could fit in the AGC rom.


Per this interview between Hamilton and Jaime Rubio Hancock (https://medium.com/@verne/margaret-hamilton-the-engineer-who...):

> Q: Was this picture taken during the Apollo project development? When was it taken and who took it?

> A: Here is a description of the photo excerpted from an MIT Draper Lab document:

> > “Taken by the Draper Lab photographer in 1969 (during Apollo 11). Here, Margaret is shown standing beside listings of the software developed by the team she was in charge of, the LM and CM on-board flight software team”.

Hamilton again, in this Vox interview (http://www.vox.com/2015/5/30/8689481/margaret-hamilton-apoll...):

> "In this picture, I am standing next to listings of the actual Apollo Guidance Computer (AGC) source code," Hamilton says in an email. "To clarify, there are no other kinds of printouts, like debugging printouts, or logs, or what have you, in the picture."


There's also the people who reportedly spoke to Ron Hackler about the photo[1][2], who notes that "they wrote all of the AGC source code on AGC source coding paper".

Such sheets would look like this: http://www.eah-jena.de/~kleine/history/software/IBM360-codin...

And would likely be much less dense than the printouts.

[1] Steve Dolha on Quora: https://www.quora.com/Was-this-pile-of-code-written-by-a-sin...

[2] This imgur post: https://www.quora.com/Was-this-pile-of-code-written-by-a-sin...


Certainly different revisions (for different missions). Also remember that surface missions required two different versions of the code: One for the CM and one for the LM.


The repo bluetomcat awk'd covers both Luminary (LM) and Comanche (CM).

EDIT: I bet he awk'd it before the repo split the files up; each is more than 1,400 pages. The total number is likely closer to 3,000.


It's probably worth linking to the prior discussion re: the Github repo itself.

https://news.ycombinator.com/item?id=12048945


Apparently Science Channel did an episode on "MIT's work on the Apollo Guidance Computer" (episode 3):

https://en.wikipedia.org/wiki/Moon_Machines#Part_3:_the_navi...

They are available on public torrent sites.


on a related note, this has passed by HN in the past and it is still fascinating to watch: http://www.firstmenonthemoon.com/


The Margaret Hamilton picture actually just shows her next to computer manuals, not code she wrote. This was cleared up in another thread a long time ago.


It's not code that she wrote (up to ~350 people worked on the code at one time) but it's not "computer manuals" either.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: