21

Sputnik 1 was the first satellite in space. Did it have a programming language on board or was it purely analog?

in 1949 Von Neumann released the language Short Code. Fortran was invented in 1957. Sputnik launched in 1957. Dennis Ritchie created the C programming language @ Bell Laboratories in 1972.

edit: Thanks for the answer and commentary, really appreciate the level of knowledge here.

For the purposes of my enquiry I'm happy to clarify the question as 'the first machine language in space'. Obviously coding would be done on the ground.

Also for the purposes of clarification: will exclude the analog examples provided. ie: only machine code running on semiconductor chips.

Another question for those interested.

What is the most popular programming language in space?

uhoh
  • 148,791
  • 53
  • 476
  • 1,473
CodingMatters
  • 545
  • 1
  • 4
  • 8
  • 2
    Sputnik 1 was little more than a battery and a radio transmitter, definitely analog. Gemini had some digital computer gear aboard in mid-60s, don't know about Mercury. – Russell Borogove Jun 02 '17 at 22:50
  • I think Sputnik 1 used some analog as well as some digital parts, but there was nothing like a programmable digital processor. – Uwe Jun 03 '17 at 13:50
  • 1
    The programming language Plankalkül was the first high level programming language. https://en.wikipedia.org/wiki/Plankalk%C3%BCl – Uwe Jun 03 '17 at 14:05
  • 8
    You need to define what you mean by "first programming language in space". Do you mean what was actually run? Do you mean what language was used on Earth to generate the code used in space? Do you mean what was the first language that was used by a human in space to actually program a computer that was also in space? There is a wide spectrum of possible meanings to your stated question. – Makyen Jun 03 '17 at 16:45
  • 5
    Your question appears to have a misconception as to how programming works: that anything other than the machine language (actual bits/bytes) would be code that runs. Computers don't run anything other than machine language. Any computer programming language (i.e. that's easier to understand by a human) is an abstraction. That abstraction must be removed prior to the computer actually understanding the code. Programs (resources) are used to do so. Such resources cost. The cost is much cheaper/safer to pay on Earth than Space, thus usually only machine language is sent to space. – Makyen Jun 03 '17 at 16:55
  • @Makyen Assuming that's true, that's really interesting! Can you cite any sources? – Ryan Jun 03 '17 at 17:04
  • 2
    @Ryan, If you want sources cited, I'm going to need to know what part you're wondering about. If it's the part about computers only actually running machine code, that's basic electrical/computer engineering. If it's the claim that "usually" only machine language is sent to space, then, at a minimum, it would need a lit search. However, it's also an easy inference from basic EE/CE. How accurate it is for a specific mission, will depend on the mission. To prove "usually" requires a survey of all missions, or the vast majority, which if not already done, would be quite a bit of effort. – Makyen Jun 03 '17 at 17:24
  • 1
    @Makyen: Interpreters are quite common in computing. The interpreter, itself in "machine code" form, runs a program that exists even while being run in a more abstract form than machine code. The interpreted program never exists in machine code form, but is undeniably being run somewhere. Doing this sort of thing is an engineering decision, and not one that is made automatically -- but the engineering benefits of using bytecode and an interpreter layer may well carry the day for at least some spaceborne applications. – hmakholm left over Monica Jun 03 '17 at 18:34
  • 1
    @HenningMakholm We appear to basically agree, but bandwidth is limited :-). While interpreted code is run, it's not what the computer (the hardware) actually runs. The actual computer runs machine code (by definition). Some machine code can be an interpreter, which is an abstraction that runs the interpreted code. Yes, there are lots of trade-offs between compiled/assembled code vs. an interpreter running on the hardware with most of the operational code being interpreted (can be better either way). As stated, those are engineering trade-offs made on a project by project basis. – Makyen Jun 03 '17 at 19:09
  • @Makyen: Also, why would you have your expensive astronaut doing programming while in space? Far more cost-effective (even at Silicon Valley salaries :-)) to have Earthbound programmers write the programs and upload them as needed. – jamesqf Jun 03 '17 at 21:42
  • Sputnik 1 had computing power on a par with a simple dial thermostat: it could react to temperature changes and communicate those changes to Earth. – Mark Jun 03 '17 at 23:43
  • @jamesqf Tell that to the Apollo 14 LM crew. – user Jun 14 '17 at 12:09
  • If the code was compiled on the ground, obviously the programming language is not needed in space. – Anixx Sep 06 '21 at 15:20

2 Answers2

46

(I'm interpreting the question as "what programming language was the first spacecraft software written in?", per discussion in comments above.)

This will depend on your definitions of "computer" and "programming language". Almost certainly the first digital computers on spacecraft were programmed in assembly language or microcode. You can get a lot of historical detail from Computers In Spaceflight: The NASA Experience.

Adoption of high-level languages happened much later in spacecraft than on the ground because, typically, assembly language is more efficient (so you can do equivalent work on a lighter, less power-hungry, and/or more radiation-hardened CPU), and gives finer-grained control to the programmer (thus less likely to produce unexpected results).

The earliest digital computer on a spacecraft I can find is Ranger 3, 1962:

Spacecraft control was provided by a solid-state computer and sequencer and an earth-controlled command system.

"Sequencer" suggests it was programmed via physical switches and/or hard-wired microcode at a quite low level, but I haven't found any real details on the computer itself.

Gemini was the first crewed US spacecraft to carry a digital computer, starting with Gemini 3 in 1965.

"The computer weighed approximately 59 pounds, performed more than 7,000 calculations a second, and needed no more room than a hatbox — 1.35 cubic feet — aboard the Gemini. It had an average power consumption of 94.54 watts, a 500 kc bit rate, a memory cycle time of 250 kc and an add time of 140 microseconds. The computer's memory was a random-access, nondestructive readout design with flexible instruction and data storage organization. Its nominal capacity was 4,096 39-bit words and its operational capacity was 12,288 13-bit words." (IBM's historical archives).

This almost certainly was programmed in assembly language rather than a high-level language.

The Galileo spacecraft flown in 1989 appears to be the first US uncrewed spacecraft flying software written in a high-level language:

JPL carefully explored memory requirements and software development prospects. Prototype programs were written in HAL/S and FORTRAN for the command computer and the attitude control computer. Ideas for the content of the programs came from Voyager experience and the executive written for the NSSC-1. The project office originally specified that HAL would be used for programming all flight software. When irreducible inefficiencies appeared in the compiler bought for the command and data computers, HAL was abandoned for that system and replaced with "structured macros". HAL was retained for the other computer system. Although most microprocessors in the scientific experiments are coded in assembler, one is programmed in FORTH, so high-level languages finally appeared on uncrewed spacecraft.

The USSR's first digital computer in space was the Argon 11c aboard an uncrewed Zond series spacecraft in 1964. I assume it was programmed in assembly language rather than a high level language.

Number representation - fixed point. Word length - 14 bits, command length - 17 bits. Number of instructions - 15.

Execution times: addition - 30 ms, multiplication - 160 ms.

RAM capacity - 128 14-bit words, ROM capacity - 4,096 17-bit words.

The early Soyuz spacecraft lacked digital computers; the Soyuz-T in 1980 appears to have been their first crewed spacecraft controlled by an onboard digital computer, Argon-16.

Representation of numbers - fixed point. Word length: 16 bits (word), 32 bits (double word); instruction length - 16 bits. Number of instructions - 32.

Speed: addition - 5 ms, multiplication - 45 ms.

RAM capacity: 3 x 2 Kbytes, ROM capacity - 3 x 16 Kbytes.

I would guess this was also assembly-programmed, though with the larger ROM and later date, a high-level language wouldn't have been out of the question.

The first high-level language on a spacecraft that I know of would be the space shuttle's HAL/S, first "delivered" in 1973 and first flown sometime between 1977 and 1981.

Russell Borogove
  • 168,364
  • 13
  • 593
  • 699
  • I wish I could up vote twice, this is a really thorough and well-linked "big picture" answer. – uhoh Jun 03 '17 at 01:06
  • ditto and thanks. Not sure why my google fu failed me at finding that information. – CodingMatters Jun 05 '17 at 00:23
  • 2
    When you mention HAL/S, don't forget the virtual machine of the Apollo guidance computer. https://en.wikipedia.org/wiki/Apollo_Guidance_Computer#Software "The AGC also had a sophisticated software interpreter, developed by the MIT Instrumentation Laboratory, that implemented a virtual machine with more complex and capable pseudo-instructions than the native AGC. [...] Interpreted code, which featured double precision trigonometric, scalar and vector arithmetic (16 and 24-bit), even an MXV (matrix × vector) instruction, could be mixed with native AGC code." – user Jun 14 '17 at 12:13
14

The first vessel that crossed the Kármán line and reached space - the German V-2 rocket - utilized a program for its analog computer, implemented as a rotating irregular disk of specific shape, with radius(angle) encoding output(input) function; the disk rotated by a motor, with angle and radius read by potentiometers, providing calculations for the control system, basing on gyroscopes and accelerometer data, and driving the servos of the control surfaces.

enter image description here

Source: Helmut Hoelzer’s Fully Electronic Analog Computer used in the German V2 (A4) rockets

SF.
  • 54,970
  • 12
  • 174
  • 343
  • 3
    If geometry can be a language, then this counts! I count it. – Baldrickk Jun 05 '17 at 13:58
  • It was not a fully electronic analog computer, the rotating irregular disk of specific shape is electromechanic, not electronic. The potentiometers for angle and radius are electromechanic too. – Uwe Sep 06 '21 at 07:52
  • This is very interesting, in the first Heinlein juvenile novel "Rocket Ship Galileo" the titular ship's autopilot works on this kind of cam-follower mechanism, this real-world device may have been the inspiration. – Organic Marble Sep 06 '21 at 16:32
  • Sure, geometry can be a language. Here are roughly two hundred of them! – Camille Goudeseune Sep 06 '21 at 20:43