
Source code from Apollo 11 open-sourced - mark_h
http://googlecode.blogspot.com/2009/07/apollo-11-missions-40th-anniversary-one.html
======
philwelch
We've talked about "software engineering" before. _This_ is it.

From mixmax's fastcompany link: "Ted Keller, the senior technical manager of
the on-board shuttle group, flies to Florida where he signs a document
certifying that the software will not endanger the shuttle". That's what's
required for real engineering in the end: an engineer to sign off on the plans
and to take responsibility if the product fails and people die.

This is alien to most software development, where "software engineering" is,
at best, a useful metaphor. This is real software engineering.

~~~
nostrademons
It's not really - do anything in avionics or health care and you have to
follow similar procedures.

The mistake is to believe that making planes fly through the air and making
140-character text messages fly through the net are the same problem, or
thinking that one is "real" engineering and the other is not. I would not want
your average Rails developer writing the code that keeps my flight flying. I
also would not want your average avionics software developer writing consumer
web software.

~~~
rbanffy
" I also would not want your average avionics software developer writing
consumer web software."

I am not sure of that part. I think I would like to be able to trust my
software just a little more. Not working properly is NOT OK.

~~~
nostrademons
There's a cost to software that always works correctly. If one of the avionics
software engineers I've worked with tried to write a consumer webapp, he'd
work so slowly that by the time the app was done, I wouldn't need it anymore.

When Reddit was young, I sent a couple bug reports and feature requests to
spez & kn0thing. Within an hour, they had the code done and up on the live
site. The cost of that was that their users did the QA, which is simply not
acceptable for avionics. But I'd rather have a feature done in an hour that
may or may not work than wait a month for a feature that I know will work, but
is probably rendered obsolete by developments elsewhere on the web.

~~~
Retric
You noticed a bug.

The system failed.

The fact they fixed it quickly is a seperate issue.

------
hugs
In the video of the landing, you can hear Neil ask about error "1202", which I
think I found in the source here:

[http://www.google.com/codesearch/p?hl=en&sa=N&cd=10&...](http://www.google.com/codesearch/p?hl=en&sa=N&cd=10&ct=rc#y6pJs7C1fqw/trunk/Comanche055/ASSEMBLY_AND_OPERATION_INFORMATION.s&q=1202%20package:http://virtualagc\\.googlecode\\.com)

Which is talked about here:
<http://history.nasa.gov/alsj/a11/a11.1201-pa.html>

~~~
LogicHoleFlaw
Ok wow, that is a fantastic and lucid explanation of both the error and the
real-time capabilities of the system. If only our desktop software was as
smart today!

------
arvid
Interesting interview with Allan Klumpp (one of the programmers)

<http://www.netjeff.com/humor/item.cgi?file=ApolloComputer>

~~~
voidpointer
Very interesting link, thanks!

In the interview, he mentioned that the folks at MIT wrote the program in
high-level-language called MAC (MIT Algebraic Compiler) and hand-compiled it
to the machine language of the actual computer which I take is what we see at
google code.

Wouldn't it be great if the MAC source would also be available for us to see?
After all, that is the context in which the actual software engineering took
place. Looking at the resulting assembly might give a somewhat distorted
impression of how the work was done.

------
basugasubaku
The BURN_BABY_BURN--MASTER_IGNITION_ROUTINE.s filename is pretty good, as is
the end of the header comments:

# HONI SOIT QUI MAL Y PENSE # NOLI SE TANGERE

[http://code.google.com/p/virtualagc/source/browse/trunk/Lumi...](http://code.google.com/p/virtualagc/source/browse/trunk/Luminary099/BURN_BABY_BURN
--MASTER_IGNITION_ROUTINE.s)

------
snorkel
More info about the instruction set:
<http://en.wikipedia.org/wiki/Apollo_Guidance_Computer>

And it's not hack-free:

The Block II AGC also has the mysterious and poorly documented EDRUPT
instruction (the name may be a contraction of Ed's Interrupt, after Ed Smally,
the programmer who requested it) which is used a total of once in the Apollo
software: in the Digital Autopilot of the Lunar Module. At this time, while
the general operation of the instruction is understood, the precise details
are still hazy, and it is believed to be responsible for problems emulating
the LEM AGC

~~~
profquail
I'm not a hardware guy (so please correct if I'm wrong...seriously), but if
it's just that one instruction that has unknown functionality, couldn't they
look at the code and the specified functionality (of all the code) and sort of
reverse engineer the logic of it? Or find one of the old computers (in a
museum or something) and examine the hardware in it?

~~~
torpor
They'd have to unwrap the instructions (hard-wire, literally) to get to the
meat of it, and even then there's no guarantee they'd be able to put it all
back together again.

Better that it just remains curious, and that we don't use AGC Version 1.0 for
future launch attempts ..

------
kqr2
For those in the Bay Area, you can see an actual Apollo guidance computer
prototype at the Computer History Museum:

<http://www.computerhistory.org/collections/accession/X37.81A>

Notice all the wire wrap!

[http://archive.computerhistory.org/resources/access/physical...](http://archive.computerhistory.org/resources/access/physical-
object/2009/05/X37-81A.01.04.lg.jpg)

The docent said that the computer would be potted before an actual launch.

------
mixmax
Now the rest of us can see what bugfree code looks like.

[http://www.fastcompany.com/magazine/06/writestuff.html?page=...](http://www.fastcompany.com/magazine/06/writestuff.html?page=0%2C0)

~~~
gaius
_the shuttle software group is one of just four outfits in the world to win
the coveted Level 5 ranking of the federal governments Software Engineering
Institute (SEI) a measure of the sophistication and reliability of the way
they do their work._

I wouldn't put too much faith in SEI CMM. The last company I worked for set up
an offshore software shop and staffed it with fresh graduates. A year later
they were SEI CMM Level 5 certified, boasted the company. This, mind, was
despite them never having delivered a complete project... And much of their
actual work being done by "contractors" (who were people laid off in the UK
and rehired there at vast expense).

~~~
wglb
There are actually more level 5's in operation. The certification process is
about having the procedures in place, and so it is conceivable that you could
get that without a delivery.

------
frisco
It's coded in a really interest dialect. Completely unreadable to me, at
least.

I wonder what the Shuttle source looks like. I'd imagine its in a higher level
language (C?), and that it's likely been rewritten several times since the
70s. It's amazing to me that people wrote this.

~~~
gaius
I'd be surprised if it wasn't Ada. Tho' Ada code was responsible for Ariane 5
exploding, so it's not a 'silver bullet'.

~~~
sp332
Well, Ada usually runs more safely if you don't explicitly disable error
handling, which is what they did to the Ariane 5.

------
jacquesm
The first things I noticed when browsing this code is the quality and quantity
of the comments.

I sometimes wish that low percentages of comments would generate a fatal
error!

~~~
MrMatt
There is definitely a balance, but high-level code, when well written, is
self-documenting. Comments should justify why something has been coded the way
it has, not tell others what the code does (unless it's justifiably
unreadable).

~~~
gaius
Yes comments should be about _intent_ , the implementation (code) should be
obvious. Often when maintaining legacy code the most important thing is to
understand what the original programmer wanted to do and why. Not that there
aren't some complete idiots writing code - but you can't know that this
seemingly stupid thing you see in your editor window wasn't the best decision
at the time given some constraint that no longer exists now.

------
Adam503
Cool. Now we can do an open source moon mission.

------
FiReaNG3L
TC BANKCALL # TEMPORARY, I HOPE HOPE HOPE

I laughed quite a bit at that :)

~~~
rbanffy
Line 666 of
[http://code.google.com/p/virtualagc/source/browse/trunk/Lumi...](http://code.google.com/p/virtualagc/source/browse/trunk/Luminary099/LUNAR_LANDING_GUIDANCE_EQUATIONS.s?r=258)

"GAINBRAK,1 # NUMERO MYSTERIOSO"

------
jodrellblank
The original Lunar Lander.

------
MrMatt
Looking through this makes me thankful for all of the high-level goodness we
get to use today.

------
bradhe
Oh lord I would love to work on this.

------
rbanffy
Great.

Now I just have to get an Apollo to use it. ;-)

~~~
basugasubaku
Or you can use the AGC emulator linked to in the blog post:

<http://www.ibiblio.org/apollo/>

~~~
rbanffy
What's the fun? No rumble, no smoke, no danger, no smell of fuel... ;-)

------
LuisBrito
i love it

