24

In the spirit of "fun polls"... What is your favorite esoteric programming language?

Guidelines:

  • One language per response, upvote to echo others' responses
  • If you can, describe what makes it your favorite
  • Provide a code sample (if practical)

See Also:


I thought it might be nice to summarize the responses, because although there are other lists (see comments below), it turns out that this list resulted in some (arguably) non-esoteric languages getting in. Also, to my knowledge none of the other lists is ranked based on votes, but these of course are. Note that only responses with at least 1 upvote are listed below.

Responses by Votes

88 accepted

Definitely LOLCODE. It elegantly combines programming language design with one of the strangest memes of this century.

Hello World example:

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

My favorite example from the Wikipedia article:

HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
   UP VAR!!1
   IZ VAR BIGGER THAN 10? KTHX
   VISIBLE VAR
IM OUTTA YR LOOP
KTHXBYE

Here's some object-oriented code, sort of:

O HAI IM thing
  I HAS A VAR ITZ "LOL"
KTHXBYE

I HAS A thing ITZ A BUKKIT
I HAS A someThing ITZ LIEK A thing

LOLCODE is also implemented as a procedural language.

44

Brain**. It lives up to its name...

36

After seeing it mentioned here, Piet, because of its startling appearance.

- "Hello, world!"

29

Definitely Whitespace which I like because it's clever and seems like it almost has to be a hoax, but it's not. Code sample not really viable in this forum, I think ;)

27

The Shakespeare Programming Language, for sure.

You really HAVE TO look at the code examples. They're huge.

26

APL! look at all the special keys that you can use in your code:

alt text

APL is a mistake, carried through to perfection. It is the language of the future for the programming techniques of the past: it creates a new generation of coding bums.

--- Edsger Dijkstra, 1968

I don't think any other language can beat that.

26

Ook! is the most esoteric programming language ever. Here is the classic hello world program written in 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! 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.

See http://www.dangermouse.net/esoteric/ook.html for a number of Ook! resources.

14

Without a doubt, INTERCAL is the best esoteric programming language. It even says it's the canonical example on the Wikipedia page!

13

LabVIEW because even the source code is graphical.

alt text

13

Befunge

Befunge is a stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, right, up or down, and loops are constructed by sending the control flow in a cycle.

The technique of using arrows to change control flow is demonstrated in the random number generator program below. Following the arrows around, the ? instructions send the instruction pointer in random cardinal directions until the pointer hits a digit, pushing it to the stack. Then the arrows navigate to the . to output the digit from the stack and return the pointer to the first directional randomiser. Note that there is no @ to terminate this program so it produces an endless stream of random numbers from 1 to 9.

Sample

vv  <      <
    2
    ^  v<
 v1<?>3v4
    ^   ^
>  >?>  ?>5^
    v   v
 v9<?>7v6
    v  v<
    8
 .  >  >   ^
^<
13

Conway's game of life

Conway's game of life has been used to implement a Turing machine

http://www.rendell-attic.org/gol/tm.htm
http://everything2.com/?node_id=1006951
http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#Notable_Life_programs

11

K Language, a wild APL/Scheme crossbreed.

Hello world:

"Hello world"

Compute maximum running sum inside a list of numbers:

|/0(0|+)\

Sudoku solver:

p,:3/:_(p:9\:!81)%3
s:{*(,x)(,/{@[x;y;:;]?&21=x[&|/p[;y]=p]?!10}?)/&~x}

N-queen solver:

qn:{[n],/{:[n=#*x;,*x;,/_f'f x,\:/:(!n)_dvl,/x]}?(f:0 -1 1+/:)@!n}
bd:{[p]`0:?.Q?p=\:!#p}

You still think Perl is terse?

11

Hands-down, my favorite esoteric language is the 2D language designed by the Cult of the Bound Variable for the 2006 ICFP programming contest.

Dear cult.cbv.discuss:

I'm pleased to announce a new programming language called 2D. This language frees the programmer from the shackles of linear programming by allowing programs to occupy two dimensions. However, unlike 3- and 4- dimensional languages like CUBOL and Hypercard, it does not distract the programmer's attention with needless dimensional abandon.

I first present an overview of the language and then delve into a more careful description of its syntax and semantics.

2D Overview

2D programs are built from boxes connected together by wires. A box takes the following form:

*=======*
!command!
*=======*

Wires can connect boxes:

*========*       *========*
!command1!------>!command2!
*========*       *========*

Each box has two input interfaces: its North and West sides. It also has two output interfaces, its South and East sides. The following box sends the input that it receives on its North interface to its East interface:

   |
   v
*============*
!send [(N,E)]!----->
*============*

Wires carry values from one box to another. Each wire starts out with no value. When a value is sent along a wire, the wire keeps that same value forever. A box will only activate when all of its inputs (zero, one, or two) have values.

The values flowing along wires take on the following forms:

val ::= () | (val, val) | Inl val | Inr val

The () value is the single base value. Two values can be paired together. They can also be stamped with the disjoint constructors Inl and Inr. Commands manipulate the structure of values and the control flow of the program by selectively sending along their outputs. For example, the 'case' command distinguishes between values stamped with Inl and Inr:

     |
     v
 *=============*
 !case N of E,S!----
 *=============*
     |
     +--------------

If this box is sent Inl () to its North interface, then () is sent along the wire connecting to the east interface. If it is sent Inr ((), ()) then ((), ()) is sent along the south interface instead.

2D programs can be organized into modules. A module encapsulates a collection of boxes and wires and gives them a name. The following module, called stamp, encapsulates the operation of applying the Inl and Inr constructors to the first and second components of a pair:

,........|.......................................,
:stamp   |                                       :
:        v                                       :
:     *=======*                                  :
:     !split N!-----+                            :
:     *=======*     v                            :
:        |       *=========================*     :
:        +------>!send [((Inl W, Inr N),E)]!------
:                *=========================*     :
:                                                :
,................................................,

(The split command splits a pair, sending the first component south and the second component east.)

A module can be used as a box itself. The following circuit sends (Inl (), Inr Inl ()) along the wire to the east:

        *========================*
        !send [(((), Inl ()), E)]|---+
        *========================*   |
    +--------------------------------+
    v
  *=========*
  !use stamp!-----------------------------------
  *=========*

Each time a "use" box is executed, a new copy of the referenced module is made (with wires carrying no values). Recursion is just a particular use of modules: modules may also "use" themselves. Mutual recursion between modules is also permitted.

A module is limited to at most one input along each of its north and west faces. It may have multiple outputs, all along its east face. When a module is executed, exactly one of its output wires must be sent a value; this is the value that the "use" box sends along its interface.

2D Syntax

Box syntax

A box's north and south edges are written with the = symbol. Its west and east edges, which must be exactly one character long, are written with the ! symbol. The box's corners are written *. No whitespace is allowed between the command and the box that surrounds it.

The concrete syntax for commands is as follows:

inface ::= N | W

outface ::= S | E

exp ::= () | (exp, exp) | Inl exp | Inr exp | inface

command ::= send []
          | send [(exp, outface)]
          | send [(exp, outface), (exp, outface)]
          | case exp of outface, outface
          | split exp
          | use "name"

Note that extra parentheses are neither required nor permitted. A space character may be omitted when the character to its left or to its right is one of ,()[] and two consecutive space characters are never allowed.

A name consists of one or more characters from the following set:

0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

If a wire is connected to the north side of a box, the v character must be used as follows:

    |
    v
  *=======*
  !command!
  *=======*

The wire can connect above any = character. If a wire is connected to the west side of a box, the > character must be used as follows:

   *=======*
-->!command!
   *=======*

At most one wire can be connected to each of a box's four faces.

Wire syntax

Wires are made from the following characters:

|-+#

Every wire must use at least one of these characters. That is, > and v alone are not valid wires.

Each character is "open" on some of its sides. The | character is open on its north and south sides. The - character is open on its west and east sides. The + and # characters are both open on all four sides.

The = character on the south face of a box is open to its south, and the ! character on the east side of a box is open to its east. The v character is open to its north, and the > character is open to its west.

All wire characters within a module must obey the following rules of connectedness:

  • For each - character, its west and east neighbors must both be open on their east and west sides, respectively.

  • For each | character, its north and south neighbors must both be open on their south and north sides, respectively.

  • For each # character, its north, south, west, and east neighbors must each be open on their south, north, east, and west sides, respectively.

  • For each + character, exactly two of the following conditions must be met: a. its north neighbor is open on its south side b. its south neighbor is open on its north side c. its west neighbor is open on its east side d. its east neighbor is open on its west side

Only the | and - wire characters are allowed along module boundaries, and they only require a single open neighbor on the inside of the module. (They do not syntactically connect to anything on the outside.)

Module syntax

The input consists of an arrangement of non-overlapping modules. Each module is bordered by the . character on its north and south face, the : character on its west and east face, and the , character in each corner. Additionally, the north face may optionally have one occurrence of the | character; this is the north input to the module. Similarly, the west input (if any) is represented by a - character. The east side of the module may have any number of occurrences of the - character; these are its outputs. A module's name must appear in the upper left corner of the module and be followed by a space.

2D Semantics

Evaluation of 2D programs revolves around a function for computing the value of a module instance. A module instance is a collection of wires, some of which have values, and the boxes that these wires connect.

A module instance evaluates in a series of evaluation steps. In each step, the "ready" boxes are identified as those boxes for which all of their inputs wires have values, and which have not yet executed in this instance. All ready boxes are evaluated (see below) in an arbitrary order. If no boxes are ready, then the module instance is finished. Its output is the value of the single output wire that has a value. If more than one wire has a value, or if no wire has a value, then evaluation fails.

Box evaluation

Boxes only execute when all of their input wires have values. This is true even if the command does not reference all of the wires.

Commands are executed as follows. First, all expressions in the command are evaluated. The expressions N and W are replaced with the values on the North and West wires, respectively. If a value is needed but no wire is connected, then evaluation fails. Then, commands are executed as follows:

send []

nothing happens.

send [(val, outface)]

val is sent along the specified outface.

send [(val1, outface1), (val2, outface2)]

val1 is sent to outface1, and val2 is sent to outface2. The two outfaces may not be equal.

split (val1, val2)

val1 is sent south, and val2 is sent east.

case Inl val of outface1, outface2

val is sent to outface1.

case Inr val of outface1, outface2

val is sent to outface2.

use mod

a new instance of the module mod is evaluated. The inputs to he module must match the inputs to this box, and are instantiated with the values along those wires. The output along the east face is the output of the module instance.

In any other situation (for example, split ()), the machine fails. If a value is sent along an outface, then there must be a wire connected, or the machine fails.

10

Perl.

You can write the most efficient (not necessarily readable) expressions.

9

Scratch, to go back to basics ;)

More at Scratch web site.

That way, I can show my nephew of 5 years old about my job ;)
And he is already explaining to me about recursion !?? (because "it makes nice drawing in scratch"...) What can I say ? He's got the latest PC, I had a ZX81... and not before 11 years old.

8

Iota: an unambiguous Turing-complete language with just two symbols. Iota exploits the amazing fact that any combinator (i.e. lambda-definable term) can be written using only the two combinators S (lambda (x) (lambda (y) (lambda (z) ((x z) (y z))) and K (lambda (x) (lambda (y) x).

This fact is closely tied to the Curry-Howard isomorphism: the types of combinators correspond to tautologies of propositional logic. For example, the type of K is A -> B -> (B -> A). Read A, B, C as variables and -> as implication. Try S: A -> B -> C -> ((A -> C) -> (B -> C). Even more, any tautology can be derived from S and K using modus ponens. Why? The rules (for abstraction and application) in typed lambda-calculus correspond to the rules (for introduction and elimination of implication) in a natural deduction system.

7

Prolog has always been a favorite of mine. The whole idea behind an executable problem specification and the simplicity of how it works behind the scenes astounds me.

7

F*ckF*ck.

From the original specification:

Censorship

For those of you who blush when reading the original syntax, wish to have your grandma proof read your code or simply don't quite wish to get fired yet. The mnemonics can be censored with asterisks or with any letter of the alphabet replacing the second and/or third characters. Censored language can be interspersed with the original more full blooded form. Some f*ckf*ck programmers choose to use the censored code for the majority of their coding so as not to distract from the value and expression of the original syntax which they save for moments of extreme aggression/inspiration.

HelloWorld in F*ckF*ck, censored accordingly:

f**k b**b!!!!!!!! a**e s**g b**b!!!!!!! f**k t**s b**t s**g c**k f**k b**b!!!!!! a**e s**g b**b!!! f**k t**s b**t s**g b**b c**k b**b!!!!!! c**k! b**b!! c**k a**e t**s b**t f**k b**b!!!!!!! a**e s**g b**b!!! f**k t**s b**t s**g c**k f**k b**b!!!!!!!!!! a**e s**g b**b!!!!!!! f**k t**s b**t s**g t**s c**k t**s!!!!!!! c**k b**b!! c**k t**s!!!!! c**k t**s!!!!!!! c**k a**e t**s b**t f**k b**b!!!!!!! a**e s**g b**b!!! f**k t**s b**t s**g b**b c**k a**e t**s b**t b**b!!!!!!!!! c**k

6

HOtMEfSPRIbNG, full stop. Programming as seen through the lens of salmon moving through a system of rivers. Sample code:

Universe of bear hatchery says Hello. World!.
 It   powers     the marshy things;
the power of the snowmelt overrides.
6

Forth

I wrote a few short programs in this many, many years ago. I really liked the whole Stack-oriented nature of it. Of course, it helped that my calculator of choice at the time was an HP-11C.

6

My favorite is ZOMBIE.

ZOMBIE is a programming language designed for Necromancers, particularly evil ones. (Actually, what other sorts are there?) ZOMBIE is an acronym, and stands for Zombie-Oriented Machine-Being Interface Engine.

Sample Programs

Hello World

HelloWorld is a zombie
summon
    task SayHello
     say "Hello World!"
    animate
animate

Fibonacci Numbers

Zombie1 is a zombie
summon
    remember 1
bind

Zombie2 is a zombie
summon
    remember 1
bind

FibonacciZombie is a zombie
summon
    remember 0
    task SayFibonaccis
     shamble
      say moan Zombie1
      say moan Zombie2
      remember Zombie1 moan Zombie1 moan Zombie2
      remember Zombie2 moan Zombie1 moan Zombie2
      remember moan 2
     until remembering 100
    animate
animate
3

Lisp. It's not esoteric really, but it does bend my mind when I use it, and it's functional enough as a language that I don't feel that I'm playing with a pointless toy.

3

Java2k could be fun :)

Java2K is not a deterministic programming language, but a probabilistic one. Even for built-in functions, there is only a certain probability the function will do whatever you intend it to do. All Functions have two different implementations. At runtime, based on a pseudo-RNG, the actual implementation is choosen. This is in line with common physicalist assumptions about the nature of the universe - there is never absolute security, there is always only probability.

More funny features can be found here.

3

Intuitive

It's identical to C except you use closing braces to open, opening braces to close, swap the meanings of + and -, * and /, ; and :, > and <, etc. Example:

int foo)int i, char c( }
    int six = 2 / 3:
    int two = six + 4:
    if )i > 0( }
        printf)"i is negative"(:
    {
{
2

Bash -- Yes, the Bourne-Again Shell, you can almost write real programs with it! Go on, try to write a web browser in bash, you can almost actually do it, and it's fun! What's more, you can use it for actually useful things, which you by and large can't in other esoteric languages. I will admit that Perl might be even more esoteric, but I love bash more.

2

Subtext. A language with a visual representation of control flow.

Look at the presentation video here: http://subtextual.org/subtext2.html

2

My favourite is Chef but I'm also a fan of Brain**** and Whitespace.

2

Logo and its famous Turtle with a pen attached to its tail :)

The following code draws a square:

FORWARD 100 ; draws a square with sides 100 units long
LEFT 90
FORWARD 100
LEFT 90
FORWARD 100
LEFT 90
FORWARD 100
LEFT 90

or with a loop:

REPEAT 4 [FD 100 LEFT 90]

Just for the record, the Hello World program in Logo looks like this:

print [Hello World]
1

Haskell. I just like it for no good reason :)

1

REXX. Common on IBM operating systems and almost completely unheard-of anywhere else. I can't remember a single thing about it now, but it's the language I first taught myself to code in, so it gets my vote.

1

Taxi. Example code (hello world) bellow:

"Hello, World!" is waiting at the Writer's Depot. 
Go to Writer's Depot: west 1st left, 2nd right, 1st left, 2nd left. 
Pickup a passenger going to the Post Office. 
Go to the Post Office: north 1st right, 2nd right, 1st left. 
Go to the Taxi Garage: north 1st right, 1st left, 1st right.
0

The most exotic language the I actually wrote usable code in is the scripting language for the BRIEF text editor (Brief was, back in it's day, by far the best MSDOS-based text editor for programmers).

The language itself was a lot like lisp.

0

MOO!

0

I really nice deep esoteric language is SNOBOL, which I tried to learn while at Uni. I was one of the standard pre-compiler available on DEC Alpha 4100. Everbody was busy learning C/C++ as part of the standard curriculum, and I thought, lets learns SNOBOL, get it under the belt before I leave. Man, that was a mistake. Its a pattern orientated very highly abstracted language.

B

SNOBOL

0

Sartre, for the tragic beauty of its programs. What other languages not only acknowledge the absurd purposelessness of cubicle life but actually require it? In what other languages is functionality subservient to the desires of the programmer to express herself? Truly, Sartre is a language for programmers, not programs. No other language is as deeply expressive as Sartre. The most basic feature of programming, conditions, is also the most basic feature of existentialism. From the spec:

[...] one may keep creating programs, one after another, like soldiers marching into the sea, but each one may seem empty, hollow, like stone. One may want to create a program that expresses the meaninglessness of existence, and instead they average two numbers.

0

Turkey Bomb, the only language that can cause alcohol poisoning.

-1

Karel the robot

-1

What about Processing?

-1

I'm still enjoying LOLCODE.

It is rather entertaining to write a program in the manner that you do with LOLCODE.

Other than that I would say my second pick goes to Taxi.

Taxi is rather confusing to have to remember everything, but at least it makes for good reading. You might be able to get a job writing Soaps through it, who knows :P

-2

APL

or maybe Brainf*&#

-3

SML

It's the favorite of none other than Satan himself.

http://en.wikipedia.org/wiki/Standard_ML