Esoteric Programming: Oh, You Think You’re So Smart? Try THESE

Ready for the big boys?  They’re ready for you!  Check out these Beasts of the Esoteric Language community — languages that require herculean effort just to make a working program.


Yet another written by David Morgan-Mar, whose baby I will have some day.  The commands and syntax in Whenever are actually pretty normal (they look like standard C) — it’s in the rules of execution that the esoterica comes out. The commands in a Whenever program will get executed, eventually. They might not get done in the order you wrote them. In fact, they almost certainly won’t — Whenever programs are treated like to-do lists, and commands are taken at random from any line in the program. So you can’t just assume it’ll march through your commands in the order you asked.

Hello world in Whenever:

1 print("Hello world!");

Pretty straightforward, but then again showing you “Hello world!” for Whenever doesn’t really convey the specialness of this language. As David Morgan-Mar says, “This is actually embarrassingly trivial in Whenever. Sort of a shame when you see it done in languages like Befunge and Malbolge.”

The challenge here is of course the fact that you have to write your algorithm so it doesn’t depend on sequential order.  That might be tricky, given how fundamental that assumption is to pretty much any algorithm ever written.  Fortunately Morgan-Mar makes it a little easier on us by allowing a command to be deferred until later, if other steps that it requires haven’t been done yet.  While this may sound like a disappointing concession to normalcy, programming in Whenever would probably be impossible without it.  Or is it?  I wonder if some genius with time on their hands could devise a Whenever implementation of some real algorithm — not just “Hello World”, but something with some meat on its bones.  Could we do an FFT in random order?  Who wants to find out?


Why must you programmers all be so precise? So hung up about “repeatability”, and “accuracy”, and “operates as intended”. Why can’t you be at peace with the natural order of the universe? Try to be more like Daniel Temkin‘s language Entropy, where disorder and decay is the name of the game.
Quote from Daniel Temkin’s Entropy page:

“Entropy is a programming language about giving up control. All data decays as the program runs: each value alters slightly every time it’s used, becoming less precise. An Entropy programmer needs to abandon the pursuit of precision which most programming demands — often working against years of habit — in order to program effectively. Any output from an Entropy program will be approximate, and the more the data is accessed, the more random it will become. The programmer has, at best, a short window to get his/her idea across before the program corrodes. The program itself is not altered — so the next time it runs, it is restored to its original condition, only to decay again through its next run.”

Wait, have I been programming in Entropy my whole life?

To watch Entropy in action, try interacting with Drunk Eliza — Temkin’s implementation of the famous chatbot Eliza (a simple chat program which fooled several users with its deceptively attentive responses) in his Entropy language.  You can interact with Drunk Eliza just as the original users did with Eliza back in the 60’s, but you get the hilarious experience of Eliza gradually losing the ability to communicate.


This one is weird for a whole mess o’ reasons:

  • Every command is made by just one character — why be inefficient and use a whole 5-letter word like “print”, when you could just use “&”?
  • You’re only allowed so much space to write your program — in fact your program can’t have lines more than 80 characters long, and you can’t have more than 25 lines. That’s pretty small. No wonder you need to be efficient.
  • Feeling constrained by the size limits for your Befunge program? Well, here’s some relief — if you want, go ahead and let your commands “wrap around” — if you hit the right edge, keep on going starting back at the leftmost edge.
  • Feeling confused by that last rule? How the hell would “wrapping around” work? Well, stop thinking about a Befunge program as a linear series of commands that get executed. Instead, picture it like Pac Man — after your program gets done executing whatever command is encoded by the current character it’s reading, it’s allowed to move in any direction — not just to the right, but up, down and left. In that sense your program is a 2D grid around which the compiler wanders, consuming instructions. Hence the wraparound rule — if your compiler hits one of the edges and is told to keep going, it just jumps back to the opposite edge. (And so your Befunge program is topologically equivalent to a torus.)
  • Mind blown yet? There’s more — your programs are allowed to modify themselves. So some of the commands can tell your compiler to modify the source code by changing characters around.
  • The point of Befunge? It is a glorious reason — it’s to make compiling as hard as possible. It’s hard enough on humans to understand the code when the instructions are free to be ordered in any direction whatsoever — now imagine being a compiler and having to make sense of it. But probably even worse from the compiler’s point of view is the self-modifying code. That means the source code might change, depending on stuff that happens later on.

Hello World in Befunge:

"dlroW olleH">:v

Doesn’t look that weird, eh? Check out “99 bottles of beer

v v0\1:\1:{CODE}{CODE}\!:p15-<          Bottles of Beer for Befunge
0 \ {befunge} >" ekaT">v                written by Brian Raiter, 5/97
0>>.0"llaw eht no "v<#,:      
"\, >"eno"^>0 #"^1^_v
c1,>51g#^_"ti"^. >vr : $
"::^" down, pass "<e 5
>^|\*25,<^ # i e ^g1<
,>052*":dnuor t"vbv:<
v0_^ . , ^< " "
>52*".ll"v >,^ fb e
v<v<v_$!|>"aw eht no r"v
""" ,: >" ;"^ f ^<@
meo >^"bottle"< "o $
o m^"re:"<v _^#g15< v_^
s"" >52*^>"s"^v"les"<,:
"^< ^"99 bott"< >^>^<
>" yub ,erots eht ot oG"^

Half-Broken Car in Heavy Traffic

Another member of the 2D-grid family of programming languages, along with Befunge (above) — it’s not quite as weird as Befunge, but I include it for the charming model for the programming flow.  In HBCHT, your program interpreter is a car, stuck in heavy traffic (as you’d guess), interpreting various road signs to figure out where to go next.  You wander around a “city” (your source code), following the signs, along the way producing the result that the programmer intended.  And what makes it “half-broken”?  To keep things from going bonkers, your car can’t turn left.  Sounds like a Hooptie to me.

Hello World in Half-Broken Car In Heavy Traffic:

     v                           >v       ^
> v  <                            v     >>^<
  v  ^  v                         v     ^
     ^  <                         v     ^
        ^                         v     ^
  >   />^<v                       v     ^
  ^  >v<  <                       v     ^
          ^                       v     ^
  ^   > />^<v                     v     ^   #
  ^   ^>v<  <                     v     ^   ^
  ^         ^                     v     ^   ^
  ^     > />^<v                   v     ^   ^
  ^     ^>v<  <                   v     ^   ^
  ^           ^                   v     ^   ^
  ^       > />^<v                 v     ^   ^
  ^       ^>v<  <                 v     ^   ^
  ^             ^                 v     ^   ^
  ^         > />^<v               v     ^   ^
  ^         ^>v<  <           >v  v     ^ >>^<
  ^               ^           ^v  v     ^ ^
  ^           > />^<v         ^v  v     ^ ^

             *** middle section cut out because man is this one long *** 
^ ^         >>^^<              v  v ^     ^
^ ^         ^                  v  v ^     ^
^ ^                            v  >>^<    ^
^ ^                            v  ^       ^
^ ^                            v          ^
^ ^                            v          ^
^ ^    v                       v          ^
^ ^    <                       v          ^
^     >^<                      v          ^
^     ^                        v          ^
^     v                        > ^<       ^
^     <                        ^
 >  ^<v
 ^ >v<<
 v >  ^<
 v ^

I admit, I chopped out a whole middle section of this one — I figured you get the idea from the 7,000 lines that I did include.  It’s a little more regular-looking than Befunge, but still pretty ridiculous for simply printing out “Hello World”.


Malboge is the Big Bad Daddy of all esoteric programming languages.  It’s sole reason for existence is to be difficult to program in — no abstract minimalism, no cutesy-pie primate languages, just straight up OBFUSCATION.  Here’s how Wikipedia describes it:  “Weaknesses in the design have been found that make it possible (though still very difficult) to write useful Malbolge programs“.   It’s so frustrating to program in that the first working Malboge program was presented to the world a few years after the invention of the language — and the composer of this Malboge program, Andrew Cooke, didn’t simply sit down and write out the program.  He had to use a computer search algorithm to gradually build a valid program through trial and error.  Since then a handful of other Malboge programs have been painstakingly created, but this is certainly not a language you pick up a certificate in at the local community college.

Hello World in Malbolge


Got that? If I coded that up and wound up missing a semicolon, I think I’d just snap my laptop in half and burn down my house.

The actual rules for how a Malbolge program is interpreted are as ridiculous as you’d expect.  I won’t even bother to give a complete description, but here’s a flavor of what to expect:

  • There are only eight possible Malbolge commands.  Seems like a reasonable number.  But the rules for interpreting the commands are a little tricky — input characters are converted to base-3 (ternary), adding the resulting number to itself, then taking the remainder after dividing by 94.  The result is a then checked to see if it’s one of the eight allowed commands.
  • Some commands are straightforward, such as printing a value to the screen.  Others are a little odder — a value of “39” (in ternary) means “rotate the ternary digit in memory by one digit”.  Another command tells the interpreter to jump to a different part of the program — the good ol’ GOTO command.
  • After a command is executed, it’s replaced in the source code by an encrypted version of itself.  Because why would you want to reuse a piece of useful code, later on in the program?

If you want to know more, Lou Scheffer keeps a copy of the original language specification by the inventor Ben Olmstead.  But if you’re up for the challenge, try writing some programs in it — something a little harder, say, 99 Bottles of Beer On The Wall.  Let’s look at a snippet of code from Hisashi Iizawa’s program that prints out the lyrics to “99 Bottles”, a program that he produced only seven years after the invention of the Malbolge language:

99 Bottles of Beer, in Malbolge:



© 2011 TimeBlimp Thith ith a pithy statement. Suffusion theme by Sayontan Sinha