esolang

A Language Programmed While Listening to Godspeed You! Black Emperor

A small FORTH whose every choice was made to annoy, down to the semicolon.

Eve, 2022 · Turing complete: unknown · ●●○ moderate · esolangs.org

Tested with 4 known programs · Test method

Run it

Expected: Hello, world!

The idea

Eve made this language in 2022, and the specification says the goal was to make it as annoying as possible to program in. Every statement ends with ﹔, the small semicolon U+FE54, and a plain ; does not work. A bite holds a number but has to be written as a quoted character, so bite 'c' pushes 99. A charms holds a character but has to be written as a number, so charms 99 pushes the letter c. A program stops with give up.

The machine

StatementDoes
bite 'a'. 'b'Push bites, written as characters, printed as numbers
charms 97. 98Push charms, written as numbers, printed as characters
dup swapCopy the top; swap the top two
sum difference product quotient remainderPop a, then b, and push a bite of a + b, a - b, a * b, a / b, a mod b
compPush 1 if the top two are equal, else 0
printPop and print
readPush a line of input as charms
loop ... endRepeat while the top is not 0
skip 'n'Pop; if it is not 0, skip the next n instructions
give upEnd the program; it must be there

Values are 8 bits. The count for skip is a bite too, so it is written as a character, and the FizzBuzz program skips 65 instructions with skip 'A'. Its empty lines count as instructions, which is why the program is mostly blank.

Example

The truth machine subtracts the character 0 from the input and loops while the result is not

The truth machine subtracts the character 0 from the input and loops while the result is not

  1. The specification says every sum and difference pushes a bite, and a bite prints as a number. So the

character 0 plus the bite 0 is the bite 48, and on 0 the program prints 48 where a truth machine would print 0.

Expected: 48

A countdown gets 3 as 'd' - 'a' and 1 as 'b' - 'a', the same trick the 99 bottles program uses.

Expected: 321

The specification also has 99 bottles of beer and FizzBuzz programs. The FizzBuzz skips the Buzz test after a Fizz, so 15 prints Fizz.

Patterns it teaches

  • Stack machines: FORTH order, with the operands in a fixed order of popping.
  • Hostile design: wrong names, a lookalike semicolon and jumps counted in instructions, blank lines included.

Further

Stack-based

Write your own in Run Convert a program from A Language Programmed While Listening to Godspeed You! Black Emperor

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: a-language-programmed-while-listening-to-godspeed-you-black.

Command line

shib run a-language-programmed-while-listening-to-godspeed-you-black -e 'charms 72. 101. 108. 108. 111. 44. 32. 119. 111. 114. 108. 100. 33. 10﹔
print﹔
give up﹔'
shib manual a-language-programmed-while-listening-to-godspeed-you-black

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/a-language-programmed-while-listening-to-godspeed-you-black.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org