Sunday morning I presented an intro to vocabulary-based esolangs to #ISEA2015. Here are links and notes.

For those brand new to esolangs, brainfuck is an important language to understand, as it was the catalyst for so much of the exploration of logic and language to follow. Inspired by Wouter Van Oortmerssen’s FALSE language, Urban Müller created the smallest compiler he could: only 240 bytes. To do this, he designed the Turing Complete language brainfuck, which has only 8 characters, all punctuation.

To write something like:

let x = 3

in brainfuck, we can’t use words such as “let,” “x” or “3,” none of which are meaningful in the language. Instead, we move the pointer to a place in memory we can think of as x and add three to it like so:

+++

It gets more complex when we get to higher numbers. If we want to begin a Hello, World program, we need the letter H, which happens to have an ASCII value of 72. We can get to 72 with 72 + signs, or more compactly with one of these:

++++++++[>+++++++++<-]>
-[>+<——-]>-

The top line above is essentially multiplication, 8 * 9. The second takes a more complex path, looping down from zero and wrapping. More of these can be seen on esolang.org’s brainfuck constants page. The code above can be tried on this brainfuck interpreter. A longer exploration of these ideas can be found in my paper on brainfuck for Media-N Journal.

 

We can think of brainfuck as a logic-based esolang, in that what makes it interesting is primarily its set of rules; even though its vocabulary (the punctuation) is unusual, the alienating experience one gets from coding in the language is due to its logic.

We can see this more clearly when we look at the language Ook! by David Morgan-Mar, created 8 years later. Ook! is a translation of brainfuck into Orangutan words. Apparently, orangutans communicate by using the word “ook” over and over, using different emphasis, here expressed through punctuation.

It’s important to note that traditional programming languages don’t emphasize the code as a text. We see the logic behind the code, the words are mostly immaterial – if we pay attention to them, this is usually a problem. We can see “print” or “printf” or “cout” or “asdsadsa” and pay attention to its usage and meaning, what it does and how it’s used. The signifier itself only holds a denotative meaning, there is no complexity – we don’t decide between “print” vs “display” to make a slightly different point; we use the one which is valid in the language. 

But Ook! is a different language from brainfuck, despite having the same logic. With brainfuck, one quickly gets used to seeing angle brackets and square brackets and reading them – the difficulty in brainfuck is how quickly the complexity this code develops. The Hello, World! program in Ook! follows identical logic to the program in brainfuck, but the resulting code is more opaque. It begins with:

Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook!

Even a simple Ook! program is impenetrable in a way that brainfuck’s programs are not: one can think in brainfuck, it is an interesting challenge. Ook!’s bizarre method of encoding brainfuck creates a greater distance between the concrete syntax and abstract syntax, making the code as text even more visible.

Ook! was the first brainfuck knock-off, but hardly the last. There are currently 39, listed here. There are also a hundred or so derivatives.

But brainfuck is not the only language which has simple “find-and-replace” equivalents. ArnoldC is a joke language that uses Schwarzenegger catchphrases. HeartForth is one of (eight or so now?) emoji languages. While HeartForth is the least annoying of these (I like it because it’s built on FORTH, a great oddball language, also historically important for esolangs – also because it has the most hearts!). ArnoldC and HeartForth add little to the conversation, and such languages create the impression that esolangs are only interesting if they have systems of logic themselves, as opposed to intervening only at the vocabulary level. However, there are other languages which show vocabulary-based esolangs can be of interest as well.

 

VerboseFuck is (yet) another brainfuck equivalent. It has each brainfuck command expanded into a painfully over-explained line of code. Instead of using a single plus sign to increment, VerboseFuck uses this:

math.equation(deref(pointer) = (deref(pointer) + byte(1)):binaryand:byte(255));

VerboseFuck implies choices it does not offer. The above line increments the byte referenced by the pointer by one. If we want to add three instead of one, we can’t change byte(1) to byte(3); instead, the entire line has to be replicated twice more. The wonderfully redundant math.equation() is not a command to evaluate an expression, anymore than byte(1) is an expression containing the number 1. None of these words or phrases have any meaning on their own, they are like phonemes which only make sense in this language when they’re combined in exactly the complete line above. More on VerboseFuck here.

Bodyfuck was discussed a few posts back – a development environment for brainfuck created in part to draw our attention to the act of programming. The gestures are the code.

’alb by Ramsey Nasser is a LISP designed as a first programming language for native Arabic speakers. The difficulties Ramsey ran into in creating the language helped expose the biases of tools and libraries unable to process non-Western alphabets. Discussed in an interview with Nasser here.

Piet is a Forth-like stack-based language whose intervention is again in the space between concrete and abstract syntax. A non-textual language, its commands are encoded in the change of hue and brightness between codels (blocks of color). The idea of 2D code was inspired by Befunge

The early Piet programs have a resemblance to algorithmic art, especically that of the early (1960′s) algorists. Here is a Piet Hello World:

And a painting by Hiroshi Kawano, a generative work using Markov Chains:

Where the Kawano piece was generated by a piece of software (then painted by Kawano), the Piet Hello World was not generated by software but by the programmer. The rules of the language run on human programmers, not on a machine.

Since programmers design these, individual taste and style can become apparent, such as in Thomas Scoch’s pieces, including the Hello World appearing on the cover of Cox and McLean’s Speaking Code. He also mimicked Mondrian – perhaps it is not a surprise that Kawano was similarly inspired by Mondrian’s work.

Richard Mitton’s Pi program is a remarkable piece; it calculates Pi using a radius (the red line at the left side of the image) and the area of a circle. Here, the circle image is the circle in code – the signifier is flattened into what it represents. What this means is that the larger the program is drawn (and so the less pixelated a circle), the more accurate a Pi program results.

The Pi program was of particular importance for me when I designed Light Pattern, which uses photographs as code. In Light Pattern, I wanted to encourage code whose text (the images) and performance (as a running program) were related. In my piece Three Lamp Events, I took the Fluxus event score by George Brecht and created a program to print his words to the screen.

Brecht’s pieces blur art and life, turning ordinary events into performance. His Three Lamp Events is the turning on and off (and on again) of a lamp. To write the code in Light Pattern, I used images of three lamps, one with a red bulb, green, and blue, to control the dominant color of the frame. Then I shot the program, turning on and off the lamps to write the script for the performance – using the performance to write the score instead of the other way around.

While the puzzle logic of languages like brainfuck, Malbolge, and Unlambda may get much of the esolang glory, intervening at the vocabulary level can explore the space between person and machine in a compelling way.