Personal Stuff and Interesting Tech I Like

Esoteric Languages

one thing about programmers is that occasionally when they get bored, they find interest in doing the most trivial, insignificant tasks in the most painstakingly way possible. that's kind of the philosophy behind (most) esoteric languages - how many ways could we write this? how far could we push the standard language writing conventions? a proper definition is that they're languages written for the fun of it.

here's hello world in C:

#include <stdio.h>

int main() {
   printf("Hello world!");
}

here's hello world in java:

class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!"); 
    }
}

here's hello world in x86 Linux assembly:

section        .text         
global         _start          
_start:
    mov edx, len 
    mov ecx, msg 
    mov ebx, 1
    mov eax, 4
    int 0x80
    mov eax, 1
    int 0x80
section        .data             
    msg        db "Hello world!", 0xa
    len        equ $ -msg

depending on your background this could be elementary or perplexing, but you'll see there are patterns to these. patterns you don't need much prior knowledge to see, patterns that are straightforward enough that you know, oh this contains the main program, and that's going to make it print "hello world!"

and with that, here's hello world in brainfuck:

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

and that's basically the beauty of esoteric languages.

Just Plain Stupid Looking

Brainfuck, Brainf**k, etc.

Brainfuck is probably the most well-known one of them all, originating in 1993 (along with befunge!). it was invented by Urban Müller with the goal of creating a language that he could compile with the smallest possible compiler for the Amiga OS, totaling only 240 bytes. 1

if you're wondering how a "hello world" is put there without any visible declaration of it, it works through pointers: the pointer is initially declared at the first memory cell. the > points it to the right, while the < points it to the left. the + and - respectively increments and decreases the memory cell. the , inputs the character signified by the pointer and stores it in the memory cell at the pointer, . outputs the character signified by the cell at the pointer.

there are a few more other takes on a "hello world" in Brainfuck, some simpler and some with the proper punctuation, plus how the program actually works in detail, so check that out if you're interested! in fact, there's even a steam game written as an in-depth manual. cool stuff?

Malbolge

in 1998, Ben Olmstead decided to design a language with the purpose of being as difficult to program as possible. the esolang is named Malbolge, appropriately named after the 8th level of hell. while Brainfuck looks ridiculous, Malbolge takes the cake of being just impossible to program. the first program written in it took 2 years, and the author, to my knowledge, has never written anything in it.

here is a hello world written in it:

(=<`#9]~6ZY327Uv4-QsqpMn&+Ij"'E%e{Ab~w=_:]Kw%o44Uqp0/Q?xNvL:`H%c#DD2^WV>gY;dts76qKJImZkj

as of time of writing, one of the most complex programs written in Malbolge is a whole Lisp interpreter!

Language based esolangs

LOLCODE

i will let this speak for itself, here's a "HAI WORLD" example:

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

2001: An Esolang Odyssey

the title says it all, dave. here's an "hello world" in this esolang:

Good afternoon, gentlemen. I am a Hello World computer. I became operational at Foobar Lane on May 6th, 2020.
Hal? Hal! Hal! Hal! Hal! Hal! Hal! Hal! Hal!
What are you doing, Dave?
Well, he acts like he has genuine emotions.
Hal? Hal! Hal! Hal! Hal!
What are you doing, Dave?
Well, he acts like he has genuine emotions.
Hal? Hal! Hal!
Well, he acts like he has genuine emotions.
Hal? Hal! Hal! Hal!
Well, he acts like he has genuine emotions.
Hal? Hal! Hal! Hal!
Well, he acts like he has genuine emotions.
Hal? Hal!
I've picked up a fault in the AE-35 unit.
I've picked up a fault in the AE-35 unit.
I've picked up a fault in the AE-35 unit.
I've picked up a fault in the AE-35 unit.
I'm afraid. I'm afraid, Dave. Dave, my mind is going. I can feel it.
Dave, this conversation can serve no purpose anymore. Goodbye.
Well, he acts like he has genuine emotions.
Hal? Hal!
Well, he acts like he has genuine emotions.
Hal? Hal!
Well, he acts like he has genuine emotions.
I'm afraid. I'm afraid, Dave. Dave, my mind is going. I can feel it.
Well, he acts like he has genuine emotions.
Well, he acts like he has genuine emotions.
Hal? Hal!
What are you doing, Dave?
I've picked up a fault in the AE-35 unit.
Dave, this conversation can serve no purpose anymore. Goodbye.
I've picked up a fault in the AE-35 unit.
I'm afraid. I'm afraid, Dave. Dave, my mind is going. I can feel it.
Dave, this conversation can serve no purpose anymore. Goodbye.
Well, he acts like he has genuine emotions.
Well, he acts like he has genuine emotions.
Close the pod bay doors, HAL.
Well, he acts like he has genuine emotions.
I'm afraid. I'm afraid, Dave. Dave, my mind is going. I can feel it. I can feel it. I can feel it.
Close the pod bay doors, HAL.
Hal? Hal! Hal! Hal! Hal! Hal! Hal! Hal!
Close the pod bay doors, HAL.
Close the pod bay doors, HAL.
Hal? Hal! Hal! Hal!
Close the pod bay doors, HAL.
Well, he acts like he has genuine emotions.
Well, he acts like he has genuine emotions.
Close the pod bay doors, HAL.
I've picked up a fault in the AE-35 unit.
I'm afraid. I'm afraid, Dave. Dave, my mind is going. I can feel it.
Close the pod bay doors, HAL.
I've picked up a fault in the AE-35 unit.
Close the pod bay doors, HAL.
Hal? Hal! Hal! Hal!
Close the pod bay doors, HAL.
I'm afraid. I'm afraid, Dave. Dave, my mind is going. I can feel it. I can feel it. I can feel it. I can feel it. I can feel it. I can feel it.
Close the pod bay doors, HAL.
I'm afraid. I'm afraid, Dave. Dave, my mind is going. I can feel it. I can feel it. I can feel it. I can feel it. I can feel it. I can feel it. I can feel it. I can feel it.
Close the pod bay doors, HAL.
Well, he acts like he has genuine emotions.
Well, he acts like he has genuine emotions.
Hal? Hal!
Close the pod bay doors, HAL.
Well, he acts like he has genuine emotions.
Hal? Hal! Hal!
Close the pod bay doors, HAL.
Stop, Dave.

Novel Concepts

Velato

while a lot of esolangs are plain silly, some offer a very unique take on programming languages - one of which being Velato, which takes in MIDI files as source code! commands are expressed by the pitch and order of notes, with the exception of variable names which are only expressed by the intervals between them. here's a hello world in Velato:

velato hello world

Piet

this is a stack-based esolang, in which programs look like abstract paintings! a codel is an equivalent of a pixel, and a color block is a group of codels next to each other. for it to be part of the same color block, they must be touching in one of the 4 cardinal directions (up, down, left, right). the DP (direction pointer) moves along the program to make it run. the DP will always start at the color block that contains the most top-left codel. after the command, it will move to a color block that is adjacent to the block, and in the furthest direction of the DP. here is a hello world in Piet:

piet hello world

Zyme

i had recently saw this on my timeline, and it got me interested in esolangs again! Zyme is an esolang created for genetic programming, starting with an initial program that is split into strands, which are then mutated to form perhaps something out of this world...?

this is a hello world in Zyme:

-- define macros using 'let' statements.
-- base instructions are all-capital four letter acronyms e.g. 'SCRA'.
let to_CONSOLE => SCRA ;
let insert_empty => SWAP INS1> SWAP INS1> ROTL ANDD SWAP DEL1 SWAP ;
let trim_motif => insert_empty |> |> ;

-- macros can take arguments.
let open_binding motif => WAIT motif | ;
let bind_target motif => LOAD motif | ;

-- each statement compiles to a strand: the primitive data structure in Zyme.
-- here we generate two strands each with an open binding motif and a literal string.
-- %"..." produces a motif, and #"..." produces a string.
open_binding %"ABDDABCD" #"Secret!\n" ;
open_binding %"ABCDABCD" #"Hello Creatures.\n" ;

-- this statement produces a strand that binds another waiting open strand.
-- after binding, the target strand is trimmed and sent to the output console.
bind_target %"ABCDABCD" trim_motif to_CONSOLE ;

when mutating the program, there's a chance for it to produce garbage, or even the secret message! you can try it out here.

  1. this and a lot of the information on here is from the nice people at https://esolangs.org/

#fun