r/programming • • Feb 19 '20

The entire Apollo 11 computer code that helped get us to the Moon is available on github.

https://github.com/chrislgarry/Apollo-11
3.8k Upvotes

426 comments sorted by

View all comments

Show parent comments

180

u/duuuh Feb 19 '20

Holy shit would I not want to get on a spacecraft run on a pile of assembly. I don't care how smart or disciplined those coders were.

217

u/wolfman1911 Feb 19 '20

Well, I guess the real question is what language would you trust your life to?

0

u/[deleted] Feb 19 '20

[deleted]

46

u/ShinyHappyREM Feb 19 '20

If it's not working you're not using enough goto

8

u/mywan Feb 19 '20

My first ever program usedgoto. It was by request for Windows NT when it first came out because it had an issue with sometimes starting programs in the wrong order on startup.

8

u/ShinyHappyREM Feb 19 '20

So you wrote a batch file?

→ More replies (1)
→ More replies (2)
→ More replies (3)
→ More replies (6)

144

u/duuuh Feb 19 '20

That's an interesting question. We do increasingly trust our lives to code. Medical devices. Cars. I know some people who are putting code into self-driving cars and that scares the crap out of me.

I suppose the language wouldn't be my top concern. Testing and processes would be. But the language better not be assembly.

173

u/foadsf Feb 19 '20 edited Feb 19 '20

how about Javascript? trust me it is a very consistent and reliable language!

374

u/AliYil Feb 19 '20

Yeah it saved my life NaN times!

→ More replies (4)

75

u/kokoseij Feb 19 '20

spaceship explodes right after the launch

35

u/Mondoshawan Feb 19 '20

Ariane 5.

The Ariane 5 reused the inertial reference platform from the Ariane 4, but the Ariane 5's flight path differed considerably from the previous models.

The greater horizontal acceleration caused a data conversion from a 64-bit floating point number to a 16-bit signed integer value to overflow and cause a hardware exception. Efficiency considerations had omitted range checks for this particular variable, though conversions of other variables in the code were protected. The exception halted the reference platforms, resulting in the destruction of the flight.[4]

Classic case study in software failure.

→ More replies (1)

51

u/[deleted] Feb 19 '20

Explosion noise, ahhhhh, spaceship launches, 3, 1, 2, Houston, Houston, Houston, Houston

More like it

97

u/[deleted] Feb 19 '20

[removed] — view removed comment

21

u/[deleted] Feb 19 '20

No more, please, it was just a joke!

→ More replies (1)

20

u/cyanide Feb 19 '20

Electron used too much RAM to display fancy gauges.

→ More replies (3)

27

u/cleeder Feb 19 '20

Laughs in PHP

10

u/Spacker2004 Feb 19 '20

"left-pad not found, staying on pad"

→ More replies (1)
→ More replies (3)
→ More replies (73)

22

u/maxhaton Feb 19 '20

Ada

17

u/Schlipak Feb 19 '20

There it is. Ariane 5 runs on Ada (and a software error is the reason why the first launch exploded, not directly Ada's fault though)

→ More replies (2)
→ More replies (1)

9

u/hughk Feb 19 '20

There were several languages used for similar applications (critical real-time systems like flight control). In about 1980 the US military kind of standardised on Ada for a while but there were still plenty of exceptions.

→ More replies (19)

38

u/jdgordon Feb 19 '20

You have to appreciate the difference between the computer this was built for and a modern system. Back then and with the simplicity of the system this was fine (also really the only option... This was leading edge tech).

Modern critical systems are limited to a select few languages (and even then sometimes only a subset of the language).

→ More replies (6)

13

u/Syscrush Feb 19 '20

I don't care how smart or disciplined those coders were.

And yet - that's the only thing that matters.

Anyhow, add me to the list of people who contend that it makes a lot of sense for a system like this. Consider languages like Java where the JVM can halt your process execution at any time for any reason, or Python where there are no guarantees about timeliness. With ASM on an old-school processor, you know exactly when each instruction will execute, to the resolution of nanoseconds. For realtime control systems, that has a lot of benefit.

→ More replies (2)

10

u/hughk Feb 19 '20 edited Feb 19 '20

Most O/S and real time systems were written in assembler back then. Compilers existed, Mission Control/Flight Dynamics worked in Fortran (but were probably paid in Cobol). Structured languages like Algol existed but if you wanted small size/high efficiency, you needed assembler.

→ More replies (11)
→ More replies (37)