The 10 Weirdest Programming Languages
Programming languages are supposed to be easy to use
and learn. They should give you structure and allow you to solve real
problems. Their syntax should be clear and understandable, and their
implementations bug-free and fast. Sometimes programming language
designers create a language that goes against these principles, either
as research or for fun. Here are 10 of the most weird and impractical
ever created.
1) LOLCODE
Few programming languages are infused with the
internet age as much as LOLCODE. It was created in 2007 by Adam Lindsay,
researcher at Lancaster University. The keywords of the language are
all capitalized and meme-fied. You can almost imagine a cat using it in
production!
HAI
CAN HAS STDIO?
I HAS A VAR
IM IN YR LOOP
UP VAR!!1
VISIBLE VAR
IZ VAR BIGGER THAN 10? KTHX
IM OUTTA YR LOOP
KTHXBYE
As with most of the languages in this list, there is
no standard library to speak of. This means that you won’t be able to
use LOLCODE for anything more than reading a file or writing text to the
console. If you need a more powerful version, check out LOLPython, which is inspired by LOLCODE and gives you access to all of Python’s powerful libraries.
For more code and examples, see this Wikipedia entry.

2) Glass
Glass is an esoteric programming language developed by
Gregor Richards in 2005. It combines an unintuitive postfix notation
with heavy object-orientation, requiring extensive juggling of a main
stack combined with its object-oriented structure. According to the
author no other language is implemented like this, because it would be
idiotic.
Here is an example of a program that outputs a Fibonacci sequence:
{F[f(_a)A!(_o)O!(_t)$(_n)1=,(_isle)(_n)*(_a)(le).?=/(_isle)^\(_n)*(_a)
s.?(_t)f.?(_n)*(_a)s.?(_t)f.?(_a)a.?]}{M[m(_a)A!(_f)F!(_o)O!(_n)=(_nlm)
=/(_nlm)(_n)*(_f)f.?(_o)(on).?" "(_o)o.?(_n)(_n)*(_a)a.?=(_nlm)(_n)*
(_a)(le).?=\]}
See more examples and notes in this esolang wiki page.
3) Brainfuck
Brainfuck is the superstar of obscure languages,
reaching almost a cult following. It is notoriously difficult to program
in, with only eight simple commands and an instruction pointer. It is
designed to challenge and amuse programmers, and was not made to be
suitable for practical use. It was created in 1993 by Urban Müller. Here
is what a “Hello world!” program looks like:
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.
<<+++++++++++++++.>.+++.------.--------.>+.>.
Read more about it here.

4) Chicken
Chicken is not only the name
of the language, but also the only keyword that is allowed in it! The
number of repetitions and new lines determines the opcode which is
executed. An example program follows. Can you guess what it does?
chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken chicken
chicken chicken chicken chicken chicken chicken
Read more about it in this article.

5) Whitespace
Whitespace is a remarkable programming language. It
understands only spaces, tabs and new lines, and ignores everything
else. This makes it possible to have a regular program written in
another language like JavaScript, the indentation of which is a program
in whitespace! Here is an example that prints out “Hello, world!”
(spaces are marked with an S and tabs with a T):
S S S T S S T S S S
T
S S S S S T T S S T S T
T
S S S S S T T S T T S S
T
S S S S S T T S T T S S
T
S S S S S T T S T T T T
T
S S S S S T S T T S S
T
S S S S S T S S S S S
T
S S S S S T T T S T T T
T
S S S S S T T S T T T T
T
S S S S S T T T S S T S
T
S S S S S T T S T T S S
T
S S S S S T T S S T S S
T
S S S S S T S S S S T
T
S S
Learn more here.

6) ///
/// is a minimalist language that consists of only one operation – string substitution in the form
/source/replacement/
.
It was invented by Tanner Swett in 2006. The language is very limited,
but some clever programmers are able to turn the string substitution
operation into fully working programs that loop and output data. Here is
a simple “Hello, world!” program:
/ world! world!/Hello,/ world! world! world!
Learn more here.

7) Befunge
Befunge is a two dimensional programming language.
Your code is placed on play field with a fixed size. Each cell of the
playfield can hold either code or data, and your program can replace any
cell it wishes with either. The interpreter starts at the top-left cell
and continues to the right. You can control the direction which the
interpreter takes with special directional instructions. For example
this is an infinite loop:
>v
^<
And this is a “Hello, world!”:
0"!dlroW ,olleH">:#,_@
Learn more here.

8) Piet
Piet is a programming language in which programs are
bitmaps which look like abstract paintings. The basic building block for
Piet programs is the color block. It supports 20 distinct colors, with
some implementations having support for more. The compilation is guided
by a “pointer” that moves around the image, from one continuous colored
region to the next. Here is a “Hello world!” program:
Hello World in Piet
Learn more on the language’s homepage.

9) Malbolge
Malbolge is a programming language invented by Ben
Olmstead in 1998, named after the eighth circle of hell in Dante’s
Inferno. The name was not chosen randomly – the language was
specifically designed to be impossible to write useful programs in. A
few years after its introduction, weaknesses were found in the design
which make it possible to write Malbolge programs. You still have to be a
cryptography scientist to write a meaningful program in it,
though.
Here is what ‘Hello World!” looks like in Malbolge:
('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#"
`CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>
Learn more here.

10) ~English
~English is a programming language that attempts to
imitate natural sounding language. Its syntax is very loose to give the
writer a greater freedom of expression. No functions can be defined by
the programmer – he may only use the built-in ones. Here is an example
program:
Display "Hello world!" and a newline.
Stop the program.
Learn more about the language here. You might also be interested in Shakespeare.

Honorary mention: JavaScript
JavaScript is the most popular programming language
today. The side effect of this is that every idiosyncrasy of the
language, however subtle it is, causes bugs in the code of thousands of
programmers every day, which earns JS a place on this list. There is an entire website
dedicated to JavaScript’s weirdness, but to give you an example, here
are two small JS snippets that are perfectly valid (you can try them out
in your console):
// This prints 10:
alert(++[[]][+[]]+[+[]]);
// And this "fail":
alert((![]+[])[+[]]+(![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]);
See these StackOverflow questions for more info: 1, 2.

Conclusion
Esoteric languages like those included in this
collection, are a way to propose and validate new ideas. Sometimes these
ideas influence the entire industry. Most of the time, though, they are
so impractical that they remain niche and esoteric. You just learned
about 10 of them, but there are hundreds more.
No comments: