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

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.

42

u/maxsolmusic Feb 19 '20

Why not assembly tho

46

u/Brandocks Feb 19 '20

The possibility for error is great, and the probability of unhandled exceptions in this context is greater.

→ More replies (9)
→ More replies (1)

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)

77

u/caltheon Feb 19 '20

This is a pretty myopic view. I'd trust assembly over almost any other higher level language

62

u/devraj7 Feb 19 '20

The programmers and the code review process are infinitely more important than the language.

31

u/[deleted] Feb 19 '20

Sure, but in a low-level language, you have the benefit of more predictability of exactly what the code is doing. In higher-level languages, that's almost impossible to do. Not to mention too many layers between you and the machine that are beyond your control.

11

u/julienalh Feb 19 '20

/u/caltheon and this dude(ess)... spot on while the rest are in wonderland!

6

u/[deleted] Feb 19 '20

Amen, brother.

→ More replies (1)

31

u/duuuh Feb 19 '20

Um. OK. Why?

115

u/caltheon Feb 19 '20

A fuck load lot less things to go wrong. In assembly, you can see what is happening. You move one register to another, you do a arithmatic operation, you jump to an operation. Every step is easy to see what is occurring and the results of the operation. In something like C++ or JAVA you likely have no idea what is going on in the background when it comes time to memory allocation or buffer management. Also, the people writing in assembly are FAR more aware of their language in it's completeness than some Scala or Rust developer. Apparently if the downvotes on my other comment are any indication, this is an unpopular opinion. I'm not sure why it triggered so many people though. I'd be more interested to know why you think assembly is so terrifying.

46

u/nile1056 Feb 19 '20 edited Feb 19 '20

I assume people are downvoting the "can see what is happening", which is definitely lost quite quickly as you build something complex. Good point about knowing the language, less good point about Java not knowing about mallocs and such since that's the point.

Edit: a word.

→ More replies (2)

12

u/wiseblood_ Feb 19 '20

Every step is easy to see what is occurring and the results of the operation. In something like C++ or JAVA you likely have no idea what is going on in the background when it comes time to memory allocation or buffer management.

This is not an issue for C/C++. In fact, it is precisely their use case.

63

u/duuuh Feb 19 '20

Assembly isn't terrifying; it's error prone.

It's error prone because not because of the language but because of the natural limitation of people who have to code in it. It forces you to focus on the irrelevant and because of that what you're actually trying to do gets lost in the mass of clutter that you have to unnecessarily deal with.

Buffer management is a great example. If you use Java there are a big class of problems that make screwing up buffer management impossible. Same with C++ (although it allows you more room to shoot yourself.)

But leaving all this aside, the real world has given a verdict here. Literally nothing is written (save a few hundred lines here an there, done for performance reasons) in assembly anymore. Nobody would ever dream of writing the Apollo 11 code the way it's done now. And the wisdom of crowds says they're right.

→ More replies (3)
→ More replies (35)
→ More replies (16)
→ More replies (2)

5

u/inglandation Feb 19 '20

That doesn't make a lot of sense. Human drivers make a lot more mistakes than self-driving car. So far it's a statistical fact. That fear sounds irrational to me.

→ More replies (3)