2024 eclipse timelapse by Ashley Lian

What is an esolang?

An esoteric language (esolang) is a collection of logically consistent syntax and modes of expression with little to no intended purpose or a purpose so incredibly niche that its usefulness is constrained to the most unique of projects. An esolang that I'm sure nearly everyone is aware of, whether they've realized it or not, is Tengwar — one of Tolkien's Elvish languages and associated script. The language is esoteric in that it serves no purpose other than to give life to one specific ficticious world, and yet it is elegant and beautiful and (most importantly) consistent — a true language. This type of creativity: the creation of something for a limited but elegant purpose, truly fascinates me.

But what I am interested here is the creation and use of esoteric languages of the programming variety. Programming languages are different than written or spoken languages in that they only need to effectively and consistently convey commands to a computer, not necessarily to a person. Indeed, some esoteric coding languages are incredibly inconvienient for humans to decipher and others are even optimized to be as difficult as possilbe to read or type. There is a beauty of sorts in these unique and goofy languages, all of which at their core perform simple, cold, logical calculations flipping bits and bytes around, but manage to do so in truly creative ways.

Change the Problem

As with any creative pursuit, it's difficult to pinpoint which esolang was the first to be created, but 1993 is seen as the year in which several competing flavors of esoteric programming first made appearances. One of these primordial languages was Brainfuck created by Urban Müller. Müller was fascinated by the fundamental simplicity of computing. He realized that all computing could be performed by a few simple actions. Instead of designing a uniquely complicated, convoluted language which can readily and elegantly tackle all matters of programming problems, Müller reduced the problem of creating a language to its most lightweight digestible parts. As he recalled in a lecture two and a half decades after Brainfuck's inception: "When the problem doesn't fit the program, change the problem." And so Müller boiled the syntax and philosophy of programming down these four fundamental principals:

  1. All numbers can be expressed by increments from zero.
  2. All operators can be expressed by increments and decrements.
  3. All variables can be expressed by stack (tape) positions.
  4. Lambda calculus can be replaced by "while" functionality.

With these principals, Brainfuck has a single "tape" of memory and only 8 commands: shift pointer left/right, (inc/dec)rement, while loop, input, and output: ><+-[],.
Printing the phrase "Hello World" in Brainfuck involves incrementing values on the tape to the letter's corresponding ascii values, outputing them one by one to the user. Here is what a Hello World program written in Brainfuck looks like, with annotations added for the output points of each printed character:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>
.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
H    E       LL   O  ,  ~ W   O      R        L   D   !

As it turns out, this set of simple commands is all that is necessary to emulate any programming problem, meaning Brainfuck is Turing Complete and can be used to emulate any other programming language. The name Brainfuck comes from the sensation experienced when trying to decipher what a Brainfuck program is trying to do, the language's simplicity results in a strangely obscure elegance, which in part resulted in its explosive popularity among niche programming circles. The Brainfuck compiler was also staggeringly small at only 240 bytes (some more recent versions shave off a few more) which added to the language's claims to esoteric innovation.

When the problem doesn't fit the program, change the problem. Urban Müller

Urban Müller's Brainfuck instantly acquired admirers and prompted many to start designing their own languages. One inspired programmer was Chris Pressey, a self-described "itinerant composer of objectionable constructions". Pressey continued the pursuit of an unintelligible programming langauge which was a difficult as possible to write and understand, the result was Befunge. In all other languages (programming or not) lines of instructions or information are just that, lines. Whether it's read left to right as in English or typical programming languages like C, LISP, or even Brainfuck, or top to bottom like some written asiatic languages, all are fundamentally 1 dimensional. Pressey chanllanged this by including directional information in Befunge to dictate which cardinal direction the interpretor is meant to take. In other words, Befunge was the first 2 dimensional programming language which can be read top to bottom, left to right, right to left, and bottom to top. This unique interpretation structure along with criptic opcode definitions results in a particularly befuddling language. I am not going to pretend to understand how Befunge works, but I've included a "Hello World" program here and you can find more information about the language in the Befunge Docs.

Befunge program to print "Hello, World!"
                   v
  >v"Hello, world!"0<
  ,:
  ^_25*,@
Befunge program to determine if a number is prime.
  222p882**1+11p>133p                   >33g1+33p   22g33g- v>22g33g%#v_v
   o                                                        >|
    2                             v,,,,, ,,,,,.g22"is prime."<
     1                            >    v^                             <
                ^_@#-g11g22p22+1g22,*25<,,,,,,,,,,,,,.g22"is not prime."<

Feeding Art to a Machine

As with any ecosystem, the nature of programming esolangs morphed and branched over the decades. It's impossible to draw a single throughline establishing the most innovative or most inspiring languages, but it is possible to define rough catagories of languages. One catagory that I find beautiful and compelling is a class of languages where to write a program is to create art. This art, when fed to a computer, will be processed as any other set of commands would.

Two languages whose programs emmulate the style of art are Shakespeare and Chef. Programs written in Shakespeare, as the name my suggest, take on the form of a Shakespearian play where the dialog of characters and play act/scene structure is interpreted into computational commands. Below is an example of a Truth Machine, a program which exits if the input is 0 and infinitely repeats if the input is 1, written in Shakespeare.

  The Truth Machine.

  Romeo, a young man with a remarkable patience.
  Juliet, a likewise young woman of remarkable grace.
  
                      Act I: The Truth.
  
                      Scene I: The Initialization.
  
  [Enter Romeo and Juliet]
  
                      Scene II: The Looping Heart.
  
  Romeo:
    Listen to your heart!  Open your heart!
  
  Juliet:
    Am I better than you?
  
  Romeo:
    If so, let us proceed to scene II.
  
  [Exeunt]

Chef is a similar in that its programs emmulate some well-known written art, in this case: cooking recipes. Though the recipes are a bit unrealistic, like this Hellow World Souffle:

  Hello World Souffle.
  
  Ingredients.
  72 g haricot beans
  101 eggs
  108 g lard
  111 cups oil
  32 zucchinis
  119 ml water
  114 g red salmon
  100 g dijon mustard
  33 potatoes
  
  Method.
  Put potatoes into the mixing bowl. Put dijon mustard into the mixing bowl. 
  Put lard into the mixing bowl. Put red salmon into the mixing bowl. 
  Put oil into the mixing bowl. Put water into the mixing bowl. 
  Put zucchinis into the mixing bowl. Put oil into the mixing bowl. 
  Put lard into the mixing bowl. Put lard into the mixing bowl. 
  Put eggs into the mixing bowl. Put haricot beans into the mixing bowl. 
  Liquefy contents of the mixing bowl. 
  Pour contents of the mixing bowl into the baking dish.
  
  Serves 1.
"Hello, World!" in Piet.

Still other languages stray away from a text-based mode of command dictation and instead opt for something purely visual. Piet, named for the Dutch Modernist painter Piet Mondrian, is one such language in which an interpretor pointer passes along the pixels of an image and performs operations based on the pixel's color. Yes, these images of blobs of color are in fact program scripts. As with all the other languages we've talked about so far, Piet has all the fundamental components and capabilities to perform any computation, from addition, to subtraction, to memory management, to interpreting other languages. Indeed, someone with way too much time on their hands used Piet to write a fully functional Brainfuck interpretor. By the way, in case the idea of constructing a unique esoteric programming language seems like an incredibly difficult thing to do (it is), both Piet and Chef were created by the same person, David Morgan-Mar. In addition to those two he's created seven others.

Brainfuck interpretor written in Piet.

A Language of Music

Some esoteric programming languages transcend the bounds and behaviors of "complete" languages and are built for such specific applications that they lose the ability to perform the standard range of computational actions and yet are able to revolutionize entire industries. An industry that recently was subject to a titanic shift of this flavor was the "live coding" music scene. Live coding is the procedural production of music using computers and computer programs that can be edited on the fly during and throughout a DJ set and is extremely popular in underground electronic clubs and festivals.

Live coding changed forever in 2015 when Devine Lu Linvega created Orca. The intrigue of live coding performances comes from the surprising construction of dense, complex, and beautiful music sprouting from procedural software. Flavor and emotion makes a piece of "normal" music worth listening to and deriving those fundamental aspects of musical arts from a heartless machine requires true skill. Live coding can be done with many languages where MIDI output is produced programmatically and output to a synthesizer, modulated, and pumped out speakers. But what Orca did differently is that the construction and processing of the program itself is as much a visual performance as an auditory one. With Orca one can see the music notes originating from random number generators, being augmented by a string of commands, and MIDI information literally flying across the screen.

Orca, and the live coding scence in general, is still niche with performances and sample tracks getting a few hundred views on Youtube. But I think it is one of the most impressive and creative tools ever made and I am in awe of all who partake. Keeping with tradition in these underground tech spaces, Orca is enitrely free to use.

Unique Limitations, Unique Solutions

There are some languages that are birthed from the fires of competition. Specifically, code golfing. Code golfing is surprisingly simple to understand: given a computational problem, write a script that solves it using the lowest number of characters possible. The idea is to have the input script to take up the smallest possible memory in text, where each character that is typed takes 1 byte of data. Take this example, using Python:

  Write a function that takes an input integer and checks if it is prime.

Simple enough, just build a "prime checker". And if you're a halfway decent Python programmer, you might come up with an answer that looks something like this:

  def is_prime(num):
  if num == 1:
     return False
  for factor in range(2, num):
      if num % factor == 0:
         return False
  return True

And that's a great start, this program uses 159 bytes. But you can do better. Remember, the goal is to have the fewest possible characters to solve the problem. Easy improvements could be to change the function name from is_prime to a single letter p. Great! That saves 7 bytes. You could do the same thing with all the other temporary variable names. Take out all the unecessary spaces too, a "space" is still a character costing 1 byte! But, a true Python code golfer can utilize tricks so infrequently seen that the perfectly optimized result doesn't even look like Python anymore:

  p=n=1
  exec(“p*=n*n;n+=1;”*~-int(input()))
  print(p%n)

52 bytes. Just like that, the "prime checker" program was reduced to one-third its original size. Some languages can do even better, like Perl:

  $_=2==grep$’%$_<1,//..$

26 bytes. That's code golf in a nutshell.

Out of this competition grew a unique class of esoteric languages whose only utility was to be a good golfing language. They could write short programs. That's it. They aren't necessarily fast, certainly are not legible, and are completely unintuitive. But that's why I love them.

The same "prime checker" problem can be solved with GolfScript:

  ~.,{*.~+}*.*\%

14 bytes.

Other languages like Pyth take advantage of frequently occuring golfing problems to condense as much functionality into as single characters. To check if a number is prime or not:

  }QPQ

4 bytes.

And out of this arms race to create the most compact possible language, came philosophical art. On May 27th, 2014, an anonymous user posted their first and only entry to the Esolangs Wiki proposing a new language, one that will forever and always be able to solve any computational problem in the fewest possible bytes: MetaGolfScript. The MetaGolfScript program to solve the "prime checker" problem is this:

 

0 bytes

Zero. Nothing. If you give MetaGolfScript an empty program file, it will check if a number is prime. Ok, technically that's missleading, MetaGolfScript isn't a magic language that can solve any computation in 0 bytes. It's actually an infinite family of languages, where there exists one langauge for each unique computational task. In this case, the language MetaGolfScript-2579603820238107378666987055701286 solves the "prime checker" problem in 0 bytes. In this sense, our anonymous friend shattered the very concept of code golfing in 2014. No matter what problem is presented, there will always exist a MetaGolfScript language that can beat all others, solving the problem in 0 bytes. You will always win a round of code golf with MetaGolfScript. For that reason, it is the only language to have received an outright ban from the official code golfing platform. I love the self-referential nature of this concept, to me it gives echoes of deeply revolutionary conjectures like Gödel's Incompleteness Theorem.

Try Before You Buy

Perhaps the most obstructive force in the esolang community and the primary reason it for so long remained a niche hobbiest community is the difficulty in building and running someone's custom language on your own machine. Esolangs aren't meant for mass production. They aren't like Swift, Apple's flagship language, ruled by a megacorporation with standards and practices to ensure the products built with it can run anywhere and everywhere. Esolangs are often entirely dependent on the software environments and hardware of the laptop they were developed on. But, as always, we cannot expect anything less than the best from the esolang community. A few solang hobbiests created Try It Online a free and open source website where all registered esolangs, including all that I have mentioned in this blog, are ready and available for anyone to try out. This is why I love the esolang and Free and Open Source Software (FOSS) community, they come to their own rescue.

Final Words and Resources

Esoteric languages in literary media bring a sense of wonder and realness to imaginary worlds be it Elvish, Klingon, or the hundreds of lesser known. Esoteric programming languages bring a similar attitude to the world of computation, they invent new ways to think about how we talk to computers, they blur the line between program and art, they are forms of expression, useful or not. Esolangs represent our extraordinary ability as humans to construct a framework of rules to convey information while capturing the uniquness that is our species' ingenuity and artistic vision. Members of the esolang community are creators and artists, observers and thinkers, programmers and linguists and painters.

I talked about many esoteric coding languages in this post, here is each language along with a link to their associated wiki page:

This post was heavily inspired by the work and curation done by Hillel Wayne in their 2021 post which can be found here.

Thank you.