6 ms·
Source code from Apollo 11 open-sourced
- jacquesm 17y agoThe 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!
- wglb 17y agoAh, but in higher-level languages comments are bugs.
- eru 17y agoKnuth would disagree. Haskell has a `mode' called Literate Haskell, were everything is a comment, unless you specify otherwise (e.g. enclose it in \begin{code} and \end{code} pairs).
- wglb 17y agoWell, I would say that Knuth doesn't put comments, he puts chapters. His code is quite a pleasure to read. I don't yet seem to be at that level of evolution yet.
- jonursenbach 17y agoCommenting _too_ much can degrade the quality of code. Be smart when commenting.
- bradhe 17y agoWhen you're working in that kind of paradigm they're pretty essential...when you have higher level constructs things are a bit more self explanatory :)
- basugasubaku 17y ago# YOU WOULD THINK THEY CAN COMMENT WITHOUT YELLING.
- helloworld 17y agoUm, dude, back in the day, all you got were CAPS. (And that was still true ten years later, in 1979, with my Apple II Plus.)
- basugasubaku 17y agoAre you sure? AFAIK the earliest LISP (1958) supported lowercase, PDP-1 (1960) had lowercase, the ancient SAIL keyboards (1960s) even had Greek letters on them.
- jacquesm 17y agoAnything that was done using punchcards was all uppercase. Btw, did you know that the 'SAIL' assembler/debugger was called 'FAIL' ?
- MrMatt 17y agoThere 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 17y agoYes 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.
- eru 17y agoSome deep algorithms may require more comments about their inner workings.
- mixmax 17y agoNow the rest of us can see what bugfree code looks like. http://www.fastcompany.com/magazine/06/writestuff.html?page=0%2C0 http://www.fastcompany.com/magazine/06/writestuff.html?page=...
- jonknee 17y agoI suppose we could if this was the code for the shuttle. But it's not.
- mixmax 17y agoI'm sure the standards are the same though.
- gaius 17y agothe 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 17y agoThere 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.
- philwelch 17y agoWe'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.
- mynameishere 17y agoIt's really not that unusual. There's a lot of machinery that can kill people and it's all run by software.
- 9oliYQjP 17y agoWhen I was in school here in Canada, we were told the story of the Therac-25 (http://en.wikipedia.org/wiki/Therac-25 http://en.wikipedia.org/wiki/Therac-25). Sadly, we're still dealing with some of the problems that plagued the Therac-25 (e.g., poor error messages, arithmetic overflows, simply assuming that software will run the same on compatible hardware, race conditions, etc.) Sometimes I read workarounds to CPU and other hardware errata in kernel modules/drivers. Given the sort of obscure problems mentioned in that code, I for one would not want to put my John Doe on any sort of certification like this. My hat's off to the guy.
- deleted 17y ago[deleted]
- nostrademons 17y agoIt'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.
- arvid 17y agoInteresting interview with Allan Klumpp (one of the programmers) http://www.netjeff.com/humor/item.cgi?file=ApolloComputer http://www.netjeff.com/humor/item.cgi?file=ApolloComputer
- deleted 17y ago[deleted]
- voidpointer 17y agoVery 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.
- jodrellblank 17y agoThe original Lunar Lander.
- frisco 17y agoIt'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 17y agoI'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 17y agoWell, Ada usually runs more safely if you don't explicitly disable error handling, which is what they did to the Ariane 5.
- stilist 17y agoYou may find this reference helpful: http://www.ibiblio.org/apollo/assembly_language_manual.html http://www.ibiblio.org/apollo/assembly_language_manual.html Found it after following up the http://ibiblio.org/apollo http://ibiblio.org/apollo link in a file header. :)
- FiReaNG3L 17y agoTC BANKCALL # TEMPORARY, I HOPE HOPE HOPE I laughed quite a bit at that :)
- rbanffy 17y agoLine 666 of http://code.google.com/p/virtualagc/source/browse/trunk/Luminary099/LUNAR_LANDING_GUIDANCE_EQUATIONS.s?r=258 http://code.google.com/p/virtualagc/source/browse/trunk/Lumi... "GAINBRAK,1 # NUMERO MYSTERIOSO"
- snorkel 17y agoMore info about the instruction set: http://en.wikipedia.org/wiki/Apollo_Guidance_Computer 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 17y agoI'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 17y agoThey'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 ..
- bradhe 17y agoOh lord I would love to work on this.
- basugasubaku 17y agoThe 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/Luminary099/BURN_BABY_BURN--MASTER_IGNITION_ROUTINE.s http://code.google.com/p/virtualagc/source/browse/trunk/Lumi...
- rbanffy 17y agoGreat. Now I just have to get an Apollo to use it. ;-)
- basugasubaku 17y agoOr you can use the AGC emulator linked to in the blog post: http://www.ibiblio.org/apollo/ http://www.ibiblio.org/apollo/
- rbanffy 17y agoWhat's the fun? No rumble, no smoke, no danger, no smell of fuel... ;-)
- kqr2 17y agoFor 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 http://www.computerhistory.org/collections/accession/X37.81A Notice all the wire wrap! http://archive.computerhistory.org/resources/access/physical-object/2009/05/X37-81A.01.04.lg.jpg http://archive.computerhistory.org/resources/access/physical... The docent said that the computer would be potted before an actual launch.
- MrMatt 17y agoLooking through this makes me thankful for all of the high-level goodness we get to use today.
- Adam503 17y agoCool. Now we can do an open source moon mission.
- hugs 17y agoIn 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&ct=rc#y6pJs7C1fqw/trunk/Comanche055/ASSEMBLY_AND_OPERATION_INFORMATION.s&q=1202%20package:http://virtualagc\.googlecode\.com http://www.google.com/codesearch/p?hl=en&sa=N&cd=10&... Which is talked about here: http://history.nasa.gov/alsj/a11/a11.1201-pa.html http://history.nasa.gov/alsj/a11/a11.1201-pa.html
- LogicHoleFlaw 17y agoOk 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!
- LuisBrito 17y agoi love it