44

I'm looking for the first written fictional programming language. This would exclude where a computer interprets human speech, and where we 'assume' a human is programming as they can be seen making input to a computer, but we don't see that input. References by name without code is also acceptable, so long as it's clearly a programming language.

The code needs to be run by something external to the writer, and should not just be a magic spell (which is equivalent to a computer interpreting speech).

I've found SARTRE but that is not in a work of Sci-Fi or Fantasy. I've also found ~ATH which would count, but is only from 2018 (as far as I can tell). There is also the computer Hex which first appears in Soul Music (1994) and runs on Softlore, though I don't know if it's named as such in the books, or if it first appears in that book. Druid Circles on the Discworld operate like computers, but we never see one being programmed.

22
  • 5
    I haven't read Richard Cook's "Wizardry" books since they came out (started 1989). Anyone with a copy they can check? The first one was in 1989 and I think I recall some programming in there, but it might have been real-life Lisp and/or Emacs Lisp rather than a fictional language. I don't remember.
    – LAK
    Commented Jul 2, 2020 at 13:59
  • 5
    The Moon is a Harsh Mistress mentions LOGLAN (in a single sentence) but that was a real language. Commented Jul 2, 2020 at 14:11
  • 4
    In the Wizardry series I know in the second book he brings in a team of programmers to create a Magic Compiler. A programming language to make casting spells easier and somewhat automated. "The Wizardry Compiled" Commented Jul 2, 2020 at 14:12
  • 24
    Babel-17 (1966) mentions ALGOL and FORTRAN, and also amusingly enough, later it mentions Ruby and Python in the same sentence! But it means two dancers with those names, not the computer languages :) Commented Jul 2, 2020 at 14:17
  • 2
    I'm sure Asimov had at least one story where a computer was programmed via code and not speaking to it ... but was it a named language?
    – davidbak
    Commented Jul 2, 2020 at 21:19

12 Answers 12

38

What about Gateway from 1977?

Interspersed throughout the book are excerpts from the main character's sessions with an artificially intelligent psychiatrist program (which he calls Sigfrid von Shrink), although those may be more logs than code.

An example showing the mixing of code and logs:

507 .IRRAY.MATURITY.GOTO             26,830
     *M80                            26,835
508 ,C, Maybe maturity is wanting    26,840

It goes on like this, but the line with GOTO is clearly intended to be code.

(page 44, SFBC edition)

8
  • 4
    COBOL inspired, perhaps.
    – Holger
    Commented Jul 3, 2020 at 12:31
  • In high school, we had a spirited discussion if this was a) real code, b) Robinette's thoughts at how Sigfrid was actually analyzing him, or c) just window dressing for the reader to remember that Sigfrid isn't a real person. The conclusion we came to was you have to read the code to realize that Sigfrid is truly alien (an invention of human minds using Heechee technology) and could have more motives that the code allows for. Commented Jul 4, 2020 at 18:03
  • @JesseC.Slicer That's a weird conclusion though. I thought Siegfried was just a computer artifact, basically inspired by the (abysmally bad) real-world ELIZA. That language evidently looks like nothing that would make sense. It's what an antagonistic neural network would come up when you feed it some 70's programming language and instruct it to generate something that looks alike. (Hey, that's a good CS term project). In-universe, humans don't even get the space capsule color coding, how would they connect anything to a computer system? Commented Jul 7, 2020 at 14:38
  • @DavidTonhofer well now you've given me a good reason to re-read the entire series. My recollection was that humans were pretty gung-ho to grab anything Heechee and try to integrate it (often with fatal results) and that Sigfrid was put together using some of their technology along with ours. Especially given that after Robinette "dies", his stored self (again, using Heechee "ancient ancestors" technology) happily interacts with Albert, which was created in the same vein as Sigfrid. Commented Jul 7, 2020 at 15:23
  • @JesseC.Slicer Ah, that must be in the followups. I just read Gateway II, found it notably inferior to Gateway (especially as it doesn't explain black holes correctly; you can't have a star system inside of one, and what's the deal with the alpha constant) so I dropped the "postquel". Commented Jul 7, 2020 at 15:32
37

The earliest I can find of what I believe is a fictional programming language is in Jurassic Park (1990). We see Dennis Nedry's code and then Ray Arnold digging into it to find the problem. As far as I can tell it doesn't appear to have a name though and neither is it totally consistent. This question about the language goes into a bit more detail on it and we get some snippets in it from the book, for example:

*/Jurassic Park Main Modules/
*/
*/ Call Libs
Include: biostat.sys
Include: sysrom.vst
Include: net.sys
Include: pwr.mdl
*/
*/Initialize
SetMain [42]2002/9A{total CoreSysop %4 [vig. 7*tty]}
if ValidMeter(mH) (**mH).MeterVis return
Term Call 909 c.lev { void MeterVis $303 }  Random(3 #*MaxFid)
on SetSystem(!Dn) set shp_val.obj to lim(Val{d}SumVal)
  if SetMeter(mH) (**mH).ValdidMeter(Vdd) return
  on SetSystem(!Telcom) set mxcpl.obj to lim(Val{pd})NextVal

Jurassic Park

9
  • 35
    It looks like someone looked over an early "Programming for Unix" Unix book and threw random bits of it at the screen while inventing madly. Commented Jul 2, 2020 at 11:31
  • 4
    @BinaryWorrier Even weirder since the answer in the linked question mention Crichton was a programmer too.
    – Martheen
    Commented Jul 3, 2020 at 0:31
  • 3
    What was the code in Sphere? That's 1987.
    – livresque
    Commented Jul 3, 2020 at 0:46
  • 2
    Congo (1980) featured a programmer as well, though I don't recall if any source code appeared in the book (or if any did, if it was simple example of a real assembly language).
    – chepner
    Commented Jul 3, 2020 at 16:03
  • 7
    It's a Unix system! I know this! Commented Jul 5, 2020 at 5:45
35

Valentina: Soul in Sapphire (Joseph H. Delaney and Marc Stiegler, Baen Books, 1984) talks about MODULISP. Here are a few lines quoting that:

She could write new machine language routines, of course, even though she herself was written in MODULISP, but she didn't know what to write.

A few minutes later she was building a MODULISP kernel.

Valentina put a last series of test programs through the MODULISP interpreter now downloaded onto the Looking Glass.

There's no actual MODULISP code included, but it apparently runs on a variety of platforms. "Looking Glass" in the above quote is a massively parallel architecture with thousands of optical processors.

12
  • 3
    That's very interesting, because it looks like it could be a dialect of LISP, but also seems to be a mathematical term as well. But it having a kernel and interpreter seem to make it inarguably a programming language based on the context.
    – AncientSwordRage
    Commented Jul 2, 2020 at 12:47
  • 3
    I think your "mathematical" hits on MODULISP are actually the phrase modulis p, i.e. "modulo p". Commented Jul 2, 2020 at 13:02
  • 17
    Perhaps a portmanteau of Modula and LISP? Commented Jul 2, 2020 at 20:36
  • 9
    To follow up, LISP was known as the language for AI, and Modula was the most innovative, influential and first Object Oriented language. The combo-name made me laugh. Both are also famously slooow. It sounds as if "she" knows that, and is rewriting herself in machine language for speed -- isn't that what "true AI" is supposed to do? Commented Jul 2, 2020 at 21:17
  • 4
    @OwenReynolds: Modula (1977) was not object-oriented at all, and even if were, it would have been 15 years late to the object-oriented party. The first object-oriented language was Simula (1962), the most innovative and influential one probably Smalltalk-72 (still 5 years before Modula). The first member of the Wirthian family of languages, to which Modula belongs (Algol-X, Algol-W (1966), Pascal (1970), Modula (1977), Modula-2 (1978), Oberon (1987), Oberon-2 (1991), Component Pascal (1994)) with at least limited OO facilities was Oberon-2 (1991). Also, I have never heard of Modula being slow. Commented Jul 5, 2020 at 5:26
29

"The Black Cloud", Fred Hoyle, 1957. https://en.wikipedia.org/wiki/The_Black_Cloud

The hero (or at least the chap who consistently made the right decision) pulled an all-nighter writing an astronomical program for the Cambridge mainframe. A fragment of this is shown in the book, it was largely symbolic (but was not APL, which hadn't yet been invented) and basically comprised whatever astronomical/astrological characters the typesetter had available.

The code, on page 32 of the paperback copy, is five lines:

  T Z 
0 A 23 ⊖ 
1 U 11 ⊖ 
2 A 2  F 
3 U 13 ⊖ 

Described as "a short sample of the code by which the computer was instructed." [apparently this is a sample of machine code]

These symbols were transcribed to a punched strip of paper, and "the holes in the paper that constituted the final instructions to the computer."

16
  • 2
    The code, on page 32 of my paperback copy, is five lines: " T Z", "0 A 23 ⊖", "1 U 11 ⊖", "2 A 2 F", "3 U 13 ⊖".
    – John Doty
    Commented Jul 4, 2020 at 21:23
  • 2
    @AncientSwordRage It is described as "a sample of the code by which the computer was instructed as to how it should perform its calculations and operations".
    – John Doty
    Commented Jul 5, 2020 at 1:42
  • 1
    This answer seems currently the earliest, and would arguably be the best if the two quotes by @JohnDoty were to be edited in. Commented Jul 5, 2020 at 5:59
  • 2
    It wouldn't have been hex, which was rarely used in those days. However on reflection it's not entirely unlike some of the coding used for e.g. early IBM computers derived from unit record machines (punched cards etc.) where the programmer was expected to know that a character or number in a specific field had some specific effect. Again on reflection, ⊖ looks like a "nothing in this field" indicator, rather than some sort of symbolic operator. I plead that I was working entirely from memory... Commented Jul 5, 2020 at 14:27
  • 10
    This is not fictional. The novel describes the real Cambridge Mathematical Laboratory, which indeed was in a building that used to be the Anatomy School as the novel says. The computer is EDSAC, which was indeed programmed via paper tape, and that is what its programming language looks like. cl.cam.ac.uk/events/EDSAC99/history.html cl.cam.ac.uk/events/EDSAC99/simulators/echo/flat.html
    – JdeBP
    Commented Jul 6, 2020 at 10:10
18

Programming a computer is often mentioned in (Science) Fiction but rarely any details are given.
It usually isn’t needed for the story itself. And many authors themselves had only a vague idea how ‘programming’ worked. Even if they did know most would realize the vast majority of their reading public wouldn’t know anything about it, so why bother?

I’m not sure if this qualifies by your restrictions, but I offer it anyway:
The Voyage of the Space Beagle by A.E. Van Vogt is from 1950.
It makes reference to ‘Symbolic Logic’ as a tool for structuring information and entering it in computers for automatic processing. It is maybe not a programming language by itself, but if I recall the novel correctly, its usage is vague enough that it could actually be the name of the programming language.

EDIT: I just discovered that the Symbolic Logic and Nexialism concepts by A.E. van Vogt are actually older. "The Voyage of the Space Beagle" is a re-work/expansion of his own short story "Black Destroyer" from 1938. The concepts where already in that short story.

9
  • Symbolic Logic may just be an old-timey way of describing a 'Programming Language' or 'Boolean Logic'. I did however find this: isfdb.org/cgi-bin/title.cgi?2687890 which is listed as 'non-fiction'
    – AncientSwordRage
    Commented Jul 2, 2020 at 11:01
  • @AncientSwordRage It is most definitely NOT a synonym for Boolean logic in the book.
    – Tonny
    Commented Jul 2, 2020 at 13:57
  • I recall that Psychology and Sociology were sciences in that future, with a mathematical basis. The main character was an expert in that new field, sent as the ship's "morale officer". I assume Symbolic Logic was something to do with that. Commented Jul 2, 2020 at 21:02
  • 3
    The "Symbolic Logic" in the book is almost certainly symbolic logic, which is very much not fictional.
    – Mark
    Commented Jul 3, 2020 at 1:17
  • 1
    @Mark I think you're right. van Vogt was really interested in this sort of thing and based several of his novels on various logic systems (e.g. the NULL-A books). Voyage is actually a rework of his own (his first work) short story "Black Destroyer" from 1938 which is a few year after Gödels initial works (1929 and 1931) on Symbolic Logic.
    – Tonny
    Commented Jul 3, 2020 at 8:22
9

As @LAK said in a comment that I noticed after I got the book from my library, in the 1989 book "The Wiz Biz" by Rick Cook, Wiz created a forth-like language to execute magical instructions to create spells. This is not "magic interpreting spoken word" but invoking a formal programming language verbally (maybe some writing, it has been a while) that Wiz developed and modifies.

http://www.goodreads.com/book/show/407212.The_Wiz_Biz

See also this question: Fantasy series with a hacker/programmer wizard and female protagonist, similar to Wiz Biz which describes other books with similar magical computer languages.

The source code is not shown (as far as I could see with a flip through the book) but is described as "a mixture of runes, numbers, and mathematical symbols appear[ing] in glowing green fire" (though might have been the object code which the forth-like language compiled to), but here are a few examples of the API (commands) that Wiz issues:

"class drone grep moria"
"$" said the Emac...
"exe," Wiz said...
3
  • 1
    I am so glad you guys mentioned this series, I read it as a kid and totally forgot about it, but enjoyed it a lot. Now to see if I can scrounge them up.... Commented Jul 4, 2020 at 0:44
  • @dwllama - If you have a copy, can you give code examples?
    – Malady
    Commented Jul 25, 2020 at 10:47
  • 1
    @Malady: No source code shown as far as I could see, see answer for a description. Commented Jul 26, 2020 at 16:48
8

I don't know if it can be considered on topic, but at the beginning and ending of Edward Wellen "No other gods" (1972) are listed some lines of a fictional code.
The language is never named, but may be named "QOGIC", since that appears in a REMARKS section on the first page (see below). The language looks almost exactly like COBOL, except that the line numbers begin with the letter Q.

Q01010 IDENTIFICATION DIVISION.  
Q01040 PROGRAM-ID. 'END RUN.'  
Q01060 AUTHOR. COMPUTER.  
Q01080 INSTALLATION. COMMUNICATIONS CENTER AT GALACTIC HUB.  
Q01100 DATE-WRITTEN. YESTERDAY.
Q01120 DATE-COMPILED. TODAY.
Q01140 SECURITY. CLASSIFIED.
Q01160 REMARKS.
Q01161 THIS QOGIC PROGRAM IS FOR THE ESTABLISHING OF TOTAL
Q01162 ENTROPY.

Here it is on Google Books.

3
  • That looks like COBOL to me (based on one mandatory course I took some 35 years ago).
    – Anthony X
    Commented Jul 5, 2020 at 21:51
  • I don't think that COBOL line numbers start with a 'Q' and I believe other languages may have used a similar number system. But as this work is published 15 years after a plausable answer that is posted prior to this answer, I am not sure this answer adds value Commented Jul 6, 2020 at 17:51
  • @JamesJenkins Honorable mentions are generally welcomed as answers on SFF.SE
    – Lexible
    Commented Jul 6, 2020 at 20:46
3

Probably not the first one, but the most advanced (or useful) is Furor. It's an interpreted scripting programming language developed by Viola Zoltán (in eastern name order), also known as Poliverzum and Harold King or Fossil Codeger. Its purpose is to be used (royalty-free) in his new Sci-Fi novels as an esoteric language by some galactic empire (I've only read a fantasy book from him "Kajjám, a Tévedés", so I don't know more about his Sci-Fi books, however I liked that one).

The language itself is Turing-complete, has a weird syntax, and the author promised to open its source code once it's complete. He released a preliminary binary interpreter for Linux (hosted by someone else), that can be downloaded from here (check the .tar.bz2 file).

He's Hungarian, I've read the aforementioned book in Hungarian, but he moved to the US, and writes his new books in English.

6
  • 3
    The question is looking for the earliest, please only answer if you think it is the earliest else this isn't really an answer and more of a comment.
    – TheLethalCarrot
    Commented Jul 3, 2020 at 14:49
  • 2
    Since OP didn't define how the "first fictional programming language" is meant. AFAIK it's the first one that is actually a working programming language with an interpreter that runs it, not just some garbage a Sci-Fi writer made up and looks like code.
    – Nyos
    Commented Jul 3, 2020 at 16:05
  • 3
    Given Hex from the Discworld is given as an example in the question, I'm pretty sure that 'working in the real world' was not required.
    – Michael
    Commented Jul 3, 2020 at 18:10
  • 7
    Interestingly, by creating a complete programming language for their Sci-Fi stories, that could disqualify itself as fictional programming language.
    – Ángel
    Commented Jul 3, 2020 at 22:15
  • 2
    Well, Elvish and Klingon were created for art. Are they fictional languages? Technically they exist, so they aren't. Also, by creating a language and naming it after the winner, you could disqualify any fictional programming language.
    – Nyos
    Commented Jul 3, 2020 at 22:57
2

@RossPresser mentioned Samuel Delaney's "Babel-17" (1966) already, but only to note that the real-life languages ALGOL and FORTRAN appear in the text. Somehow he missed mentioning that Babel-17 is itself the name of a fictional language. It is initially presented in the story as being a natural language that the protagonist must learn, but in a major plot point is later revealed to be a programming language. Now arguably it doesn't fit because the, er, 'machines' being programmed are not mechanical but are other sentient creatures. But it does meet fit the requirement that a human can compose a program in Babel-17 that is run elsewhere, specifically in the brain of a target adversary.

1
  • Thank you, I hadn't thought about that one. Commented Jul 30, 2020 at 18:22
1

1983, Superman III

Superman III (DenOfGeek article includes screen caps and discussion of exactly this topic) features Gus Gorman doing some coding.

Whilst it is clearly some variation on BASIC or LISP, equally clearly it does not make functional sense in any known language and therefore by definition is a fictitious language. (In-universe anyway; out-of-universe we know it's just something put together to fill a screen convincingly enough for a couple of seconds of film, of course.) The language itself is not named in the film, but in-universe it exists, apparently works, and can be seen being entered.

5
  • Doe you have any screen caps? I can only remember the kryptonite scene where he types human language in and the computer interprets it.
    – AncientSwordRage
    Commented Jul 4, 2020 at 9:39
  • 1
    @AncientSwordRage The DenOfGeek link includes some screen caps from Gorman's training session at the start of the film. I've edited my answer to make this clearer.
    – Graham
    Commented Jul 4, 2020 at 10:06
  • 2
    I think even the article implies it's BASIC, unless I've misread it?
    – AncientSwordRage
    Commented Jul 4, 2020 at 10:43
  • The program-within-a-program is missing FORs and LETs, so at best it is Syntax error in 10.
    – JdeBP
    Commented Jul 5, 2020 at 8:01
  • 1
    That's just BASIC on the screen. Funny thing is that it's mostly PRINT statements which are printing... more BASIC! Leaves me to wonder if it was prepared as a sort of production in-joke.
    – Anthony X
    Commented Jul 5, 2020 at 21:59
0

This is for consideration since I don't think it fully matches OP's criteria. In "The Lost Worlds of 2001" (1972) one of the draft scripts describes one of the astronauts spending some hours modifying and testing the ship's computer's program to allow him to take one of the pods out, despite none of the others being conscious. The programming language is unnamed, no example is given, and the draft was unpublished.

In one of the sequels, HAL's architecture is described in terms which make it sound like some sort of dataflow machine, with the possibility of "memories in transit" being overlooked by the remedy which removed Hal's psychoses.

Separately, in Imperial Earth (1975) I think there was an example of "if this happens then do that" programming of the protagonist's PDA. Again, I don't have my copy to hand so can't check.

2
  • For Imperial Earth, did you mean this passage? "There was no # or EXECUTE sign at the end of the sequences, but that proved nothing at all, for few people bothered to write down anything so obvious; nine times out of ten, it was omitted as understood. Yet one of the standard ways of canceling a secret ERASE order was to hit EXECUTE twice in quick succession. Another was to do so with a definite interval between the two keyings. Did Karl’s omission have any significance, or was he merely following the usual convention?" Commented Jul 30, 2020 at 18:32
  • Quite possibly, but you'll have to excuse my being vague: my copy's inaccessible (which doesn't stop it from being one of my favourite Clarke books). Commented Aug 1, 2020 at 12:57
-1

ICE, from Burning Chrome (1982). ICE stands for Intrusion Counter-measures Electronics. While it's called electronics, the way it's used in the book clearly depicts it as a programming language. This makes sense in the context of the computers that existed at the time, which would often be hard-coded logical circuits used to accomplish specific tasks, such as bank account management and simulations of newtonian movement; in other words, the circuit to accomplish the program was the program. While no name is given to the language(s) the characters actually write in, the book makes it clear that the visuals present in the character's hallucinations are programs created in ICE.

All right, there seems to be some confusion about what a programming language is. I take a very broad view; a programming language is a computer program that provides an abstraction of a logical circuit. Note that it isn't what "creates" a computer program; it creates an abstraction for the logic behind the program. If you wanted to, you could directly construct any computer program you liked out of AND gates, OR gates, and a storage buffer of some kind, and it's never a programming language that does the actual construction of the program anyway; it only serves as the rules for construction. Programming languages do us the kindness of abstracting the idea of a certain combination of those gates into something that makes more sense for humans. Under the header of what I consider a programming language includes Verilog, C, Python, Powerpoint, Minecraft, and the fictional ICE, which is clearly the abstraction of the logic for defense programs in the world of Burning Chrome and Neuromancer.

Okay, I've been downvoted to the pits of stackexchange hell, and apparently no one else seems to think that ICE is a programming language. Instead of deleting the post, I'm just going to see how far we can dig this hole:

  • ICE isn't a programming language, it's a class of software!

So are IDE's. And so are word processors, spreadsheet applications, and the many games that include functions that allow the user to create and run programs within the game, which I also consider programming languages in and of themselves, as they create a different abstraction from other languages of their underlying logic. ICE obviously represents the underlying logic of the defense systems in the world of Burning Chrome, and can be modified on-the-fly by the main characters as they work towards their goal.

  • Programming languages must be written!

See: Scratch, Minecraft, Powerpoint

The idea that a language must be written might also be seen as somewhat offensive by those that speak primarily in a gesture-based language such as ASL, and comes across as just a little tone-deaf considering many of the large number of languages currently on the brink of extinction are unwritten - https://www.nytimes.com/1991/12/31/science/in-a-publishing-coup-books-in-unwritten-languages.html

  • Neuromancer came before Burning Chrome!

Yes, and, no. Burning Chrome the short story was released 1982, Neuromancer was released 1984, and Burning Chrome the short story compilation was released 1986. See https://omnimagazine.com/taking-agency/

12
  • 4
    ICE seems to be a program and not a programming language. Like a mean firewall. In the last 1/2 of your answer you even say that: "while no name is given...". The stuff about dedicated electronics -- it's Sci Fi, so maybe Mr. Gibson was thinking that, but probably not. For real, late 1970's had special banking computers, but were still programmed. Commented Jul 4, 2020 at 4:06
  • 2
    His later book, Neuromancer expands on ICE, decks, cyberspace... and it's famous. You'll find many descriptions of ICE as a security program. As far as walls of ice, jacked-in hackers see cyberspace as a virtual world -- a wall of ICE is somewhat like a minecraft wall of RedStone. Commented Jul 4, 2020 at 19:41
  • 1
    And ICE is not a language, nor a specific program. It's a class of software, like "word processor" or "spreadsheet software". Commented Jul 6, 2020 at 19:23
  • 1
    Yes, Burning Chrome was released before Neuromancer (omnimagazine.com/taking-agency). You're thinking of the 1986 short story volume of the same name. And there doesn't have to be a difference between a class of software and a programming language. As I mentioned, many video games and word processors have features that allow the user to program at a high level, and so can be referred to as programming languages within my definition of the term.
    – odd135
    Commented Jul 7, 2020 at 13:33
  • 1
    @odd135 "Programming languages must be written!" I don't think it's necessary to plumb^H^H^H^H^H scale the heights of political correctness to discuss this. OP said that it shouldn't simply be a spoken set of instructions and the implication was that it should be entered via some form of terminal; I suggest that since APL is a bona-fide computer language and since I believe there is a Russian programming language using Cyrillic, then it would also be fair to consider computer languages based on Arabic or Chinese characters hence that high level descriptions like Scratch are entirely fair game. Commented Jul 8, 2020 at 10:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.