Like other embedded systems, spacecraft computers use real-time operating systems (RTOS) and languages:
* The Rosetta probe ultimately runs SCL (Spacecraft Command Language) [1], a COTS spacecraft programming language developed for sale to the military [2]; SCL is based on the syntax of Ada 83, which has a long legacy in spaceflight and other real-time applications (e.g. Boeing 777) [3]. However, what are known as Flight Control Procedures (uploaded commands), are written using another language and transformed and compiled into SCL in a two-step process that involves XSLT [1]. On-board Control Procedures, which are procedures the probe decides on its own to run, and handle tasks such as receiving FCPs and sending back telemetry, are written in SCL [1].
* The Mars rover Curiosity is programmed in C and uses the VxWorks RTOS [4], which is very much like many commercial embedded systems. It has about 2.5 million lines of code, much of it autogenerated. Curiosity's predecessors, Spirit and Opportunity, used the same software stack, as did their predecessor, Sojourner [8].
* The Voyager probe, which has now left the solar system and entered interstellar space, uses "...interrupt driven computer[s], similar to processors used in general purpose computers with a few special instructions for increased efficiency. The programming is a form of assembly language." [5]
* The Space Shuttle was programmed in a custom language called HAL/S (High-order Assembly Language/Shuttle) [6], as was the Jupiter probe Galileo [7]. The language is descended from PL/I and its compiler is written in a subset of PL/I called XPL.
Very interesting. I didn't think C would be used that much (except for the core of the os of course). I somehow thought of either a specialized language with strong guarantees (such as ADA), or a high level language for IA-like feature.
Which makes me wonder, since this is HN after all, if Rust wouldn't be an ideal candidate for coding this kind of layer in the future. Maybe a compiler targeting VxWorks is in progress somewhere.. ? :))
Anything even remotely new is usually not a candidate for these types of long duration missions. Part of it is institutional inertia, but also partly a desire to use a technology stack that will still be in use decades from now. Even for missions that only take a few years, some of the same people will work on those missions as well as decade plus missions, so you have to hire people who are experts in mature technologies. Institutions like NASA and ESA want to work with a technology stack that will remain stable and which they know will be maintainable by people in the future.
C and languages that compile to C (Fortran is used as well) are often employed since you have powerful control over memory usage.
Source: I work in the aviation industry, where the technologies are different but the lifecycle concerns are very similar.
* The Rosetta probe ultimately runs SCL (Spacecraft Command Language) [1], a COTS spacecraft programming language developed for sale to the military [2]; SCL is based on the syntax of Ada 83, which has a long legacy in spaceflight and other real-time applications (e.g. Boeing 777) [3]. However, what are known as Flight Control Procedures (uploaded commands), are written using another language and transformed and compiled into SCL in a two-step process that involves XSLT [1]. On-board Control Procedures, which are procedures the probe decides on its own to run, and handle tasks such as receiving FCPs and sending back telemetry, are written in SCL [1].
* The Mars rover Curiosity is programmed in C and uses the VxWorks RTOS [4], which is very much like many commercial embedded systems. It has about 2.5 million lines of code, much of it autogenerated. Curiosity's predecessors, Spirit and Opportunity, used the same software stack, as did their predecessor, Sojourner [8].
* The Voyager probe, which has now left the solar system and entered interstellar space, uses "...interrupt driven computer[s], similar to processors used in general purpose computers with a few special instructions for increased efficiency. The programming is a form of assembly language." [5]
* The Space Shuttle was programmed in a custom language called HAL/S (High-order Assembly Language/Shuttle) [6], as was the Jupiter probe Galileo [7]. The language is descended from PL/I and its compiler is written in a subset of PL/I called XPL.
[1]: http://www.rheagroup.com/wp-content/uploads/2014/01/SpaceOps...
[2]: https://www.sra.com/scl/
[3]: https://en.wikipedia.org/wiki/Ada_(programming_language)
[4]: http://programmers.stackexchange.com/a/159638
[5]: http://voyager.jpl.nasa.gov/faq.html
[6]: https://en.wikipedia.org/wiki/HAL/S
[7]: https://en.wikipedia.org/wiki/Galileo_(spacecraft)
[8]: http://programmers.stackexchange.com/a/159687