Weird Computer Languages: A Hacker’s Field Guide

Why do we build radios or clocks when you can buy them? Why are we flashing LEDs for no apparent reason? Why are we trying to extract an extra frame from our video cards? We don’t know why, but we do. This is perhaps the same attitude most people would have when learning about esolangs – esoteric programming languages ​​- we don’t know why people create or use them, but they do.

We’re not talking about mainstream languages ​​that annoy people like Lisp, Forth, or VBA. We’re not talking about older languages ​​that seem encrypted today like APL or Prolog. We’re talking about languages ​​that are made to be… well… weird.

INTERCAL

We have to start at the beginning. INTERCAL. It started as a joke in 1972 and the acronym allegedly stands for Compiler Language With No Pronounceable Acronym. However, there was no actual implementation until around 1990. There are now two: C-INTERCAL and CLC-INTERCAL.

Since INTERCAL is a parody, he makes some very strange choices. For example, bitwise operators like AND work with two arguments, but one of the arguments is reversed. That is, the upper bit of one operand corresponds to the lower bit of the second operand. In a nod to social convention, there is a modifier known as PLEASE that you should sometimes use when, for example, reading data as in “PLEASE READ IN”. If you don’t use it often enough, the build will fail, warning you that the program isn’t polished enough. However, if you use it too often, you will also get an error that your program is overly polite.

The implementation originally used EBCDIC, so it uses some characters that don’t appear on conventional 7-bit ASCII systems. This forced some character substitutions and now with Unicode some versions will allow old style characters if you prefer them. The INTERCAL manual renames almost all special characters for more confusion. A single quote is a “spark” and the equal sign is a “half stitch”. Only the ampersand remains unscathed.

Want to know more? Be careful what you wish.

FALSE and Brainf**k

Fast forward to 1993 with the birth of FALSE, a stack language designed to be unreadable. As a consolation, the compiler only needed 1024 bytes. This inspired an even more minimal language, Brainf**k. There are only eight characters needed in a BF program.

Brainf**k spawned many similar languages ​​like Befunge and JSF**k. If you’ve only heard of one language in this article, it’s probably this one.

What does it look like? From Esoteric language wiki:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

It’s Hello World, by the way!

Binary Combinatorial Logic and Unlambda

We once knew a college professor who used to say “maximize boolean variable” when he meant “set the bit to 1”. We think he would like BCL. If you want to express true in BCL, you write K(KK). False? K(K(SK)). It gets worse from there. Here is XOR: S(S(S(SS)(S(S(SK)))S))K.

However, it’s binary, so S is really 01 and K is 00 and the left parenthesis is a single 1. Super weird and apparently has application in some theoretical math studies.

There are several versions, all slightly different. Unlambda, for example, uses many different characters. Here is a “chat” program in Unlambda:

```s`d`@|i`ci

white space

Most programming languages ​​don’t care about white spaces and you can use them freely or not. That is, in C we can write:

x=10*2;

Where:

x = 10

*

2;

The compiler doesn’t care. Python is different. Indentation levels are important. white space takes this to the extreme. The whole program is written in tab, space and newline, and everything is ignored. It might sound weird, but interestingly, it allows you to hide a program inside another program – as long as it’s not a Python program.

The first space character tells you what the next one means. For example, all flow control sequences begin with a newline. Stack manipulation begins with a space. A tab and a line break introduce I/O operations. One tab and one space are for math and two tabs handle heap access.

Even numbers are in binary where a space is positive, a tab is negative. After that, a space is 0 and a tab is 1.

LOLCODE

While whitespace is perhaps even less understandable than Brainf**k, some languages ​​try to mimic particular readable things. Example: LOLCODE which has programs that match the legends of LOLCAT memes. Apparently LOLCATs were the main reason the internet was invented, after all.

Why do we assume that cats talk like that? We’re not sure, but we have a feeling the narrative inside a real cat’s brain is more like “It sure is hard to find good servants these days!” The ancient Egyptians loved cats and cats have not forgotten that.

Here is a program to count to 10:

HAI 1.3
IM IN YR loop UPPIN YR var TIL BOTH SAEM var AN 10
VISIBLE SMOOSH var AN " " MKAY!
IM OUTTA YR loop
KTHXBYE

rock star

Maybe you’re not a fan of LOLCATs but you like rock music. Well, Rockstar is the programming language for you. Variable names can be almost anything and data has types like “mystery”.

We assume that to be a good coder in this language, you need to grow your hair, mumble, and own at least one piece of spandex clothing. Come to think of it, that describes quite a few programmers we know.

Among the clever things it does, numbers are expressed in word length, and many programming constructs have “obvious” correlates in English. Thus, “Hate is water” assigns 5 to the “Hate” variable.

Here is Fizbuzz written in rock star:

Midnight takes your heart and your soul
While your heart is as high as your soul
Put your heart without your soul into your heart

Give back your heart

Desire is a lovestruck ladykiller
My world is nothing 
Fire is ice
Hate is water
Until my world is Desire,
Build my world up
If Midnight taking my world, Fire is nothing and Midnight taking my world, Hate is nothing
Shout "FizzBuzz!"
Take it to the top

If Midnight taking my world, Fire is nothing
Shout "Fizz!"
Take it to the top

If Midnight taking my world, Hate is nothing
Say "Buzz!"
Take it to the top

Whisper my world

Shakespeare

If rock music is too mundane for you, there’s always SPL, Shakespeare’s programming language. Like Bard, the programming language is not known for its economy of words.

Numbers are especially tricky in SPL. Nouns have a value of -1 or 1 depending on how nice they are (e.g. trees and flowers are worth 1 while pigs are worth -1). Adjectives multiply by 2. So, “stupid liar fatherless fat half-witted smelly coward” is -1 (coward) * 2 * 2 * 2 * 2 * 2 * 2 = -64.

Around the Hackaday water fountain, we thought of writing a new version of this language where all the programs take the form of a conversation between the bard and Sir Francis Bacon. We’ll call it Shake ‘n Bake.

Here is just part of line 89 hello world script — uh — program:

The Infamous Hello World Program.

Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.


Act I: Hamlet's insults and flattery.

Scene I: The insulting of Romeo.

[Enter Hamlet and Romeo]

Hamlet:
You lying stupid fatherless big smelly half-witted coward!
You are as stupid as the difference between a handsome rich brave
hero and thyself! Speak your mind!

You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer's
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!

You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.

Speak your mind!

[Exit Romeo]

Scene II: The praising of Juliet.

[Enter Juliet]

Hamlet:
Thou art as sweet as the sum of the sum of Romeo and his horse and his
black cat! Speak thy mind!

Malbolge

Malbolge was designed to be difficult to use. Apparently the first program to print hello world required another computer program to search through all possible programs until it found the correct sequence. If you don’t recognize the reference, Malbolge is a misspelling of Malebolge, Dante’s 8th circle of hell Hell.

Malbolge uses a base three virtual machine. There are only a few instructions, including rotate right and the “crazy” operation which changes bits in a way defined in a table and – as far as we know – has nothing to do with an operation normal math, and is essentially encryption. Malbolge is so awful that there are attempts like Dis that have been made to be “a little less evil”.

Piet

Have you ever noticed that in sci-fi movies aliens almost always communicate using some kind of sound we can hear? Either they speak English or they speak something like Andy Kaufmann doing a character. Rarely do you see aliens flashing lights, emitting pheromones, or emitting low-frequency radio waves to communicate. All of the languages ​​in this list use characters of some sort in the form of numbers, symbols, or words. Except Peter. Piet’s programs are abstract art of the genre created by Piet Mondrian.

A single unit of code is a codel and blocks of codels have the same color. The “program counter” can move in two dimensions, of course. If Piet interpreted, for example, red as an addition and green as a jump, then it would be another form of symbols. But that’s not how it works. Instead, the performer watches the change in hue and intensity between colors. Thus, a hue step and no brightness change is an add operation. But if the color gets darker, it’s subtracting. Here’s hello everyone to Piet. Don’t ask us to explain it to you!

Why? Why?

It is not worth asking why people create or use these languages. Why do people buy pet stones? Why do people collect postage stamps? They just do. Still, learning a bit of one of these quirky languages ​​can take you out of your comfort zone, and that’s not always a bad thing. Also, many people would say that writing an assembler for a PIC or AVR is only slightly less enigmatic than Malbolge and many Hackaday readers do.

As for us, we will stick to more practical programming languages. Forth sounds enigmatic, but he’s brilliant and can create programs that are very readable in the hands of an expert. However, we occasionally dive into these languages ​​for fun.

Comments are closed.