After seeing last week’s xkcd, I was reminded of the delights of learning Lisp (or in my case, Scheme) as an undergraduate. I’m a big fan of declarative programming in general — I think exposure to functional and logic programming languages develops your problem solving skills and refines how you think about programming, by focusing on the logic of a computation without getting distracted by its control flow (although this discussion has been going on for many years). It has served me well: I used logic programming (Answer Set Programming) extensively in my PhD and I dabbled with OCaml whilst a research intern at ARM; although I have used very little Haskell, I know a man who does. There seems to be a wider trend of functional programming techniques moving into the mainstream, especially with the release of F# as part of Visual Studio 2010.
Anyone who has used Lisp for any amount of time will fondly remember its enthusiastic use of parentheses. But you can embrace the Lisp philosophy a little too much. Parenthetic is a programming language that only uses ( and ) as code; all other characters are considered comments. Parenthetic uses Lisp-style expressions where parentheses enclose expressions; programs with unmatched parentheses are invalid. It looks pretty similar to another esoteric language called Parenthesis Hell, and has most of the basic Lisp features, including lambda for anonymous functions. To demonstrate a nice simple code example, the following Parenthetic program prints ‘Hello World’:
((()()())(()(()()))((()(()))((())()()()()()()())((()()(()))((())()()()()()()()()()) ((())()()()()()()()()()()))))((()()())(()(()()()))((()(())(())())((())()()()()()()( )()()()()()()()()()()()()()()()()()()()()()()()()())))((()(()))((()(())(())())((()( ()))(()(()()))((())()()()()()()())))((()(())(())())((()(()))(()(()()))((())()()()() )))((()(())(())())((()(()))(()(()()))((())()()()()()()()()()()())))((()(())(())())( (()(()))(()(()()))((())()()()()()()()()()()())))((()(())(())())((()(()))(()(()()))( (())()()()()()()()()()()()()()())))(()(()()()))((()(())(())())((()(()))(()(()()))(( ())()()()()()()()()()()()()()()()()()()()()()())))((()(())(())())((()(()))(()(()()) )((())()()()()()()()()()()()()()())))((()(())(())())((()(()))(()(()()))((())()()()( )()()()()()()()()()()()()())))((()(())(())())((()(()))(()(()()))((())()()()()()()() ()()()())))((()(())(())())((()(()))(()(()()))((())()()()))))
Pretty expressive, I’m sure you’ll agree.
There has been a rich history of developing bizarre programming languages; for example, Brainfuck, an eight-instruction Turing-Complete programming language, and Ook!, a programming language designed for orangutans (essentially isomorphic to Brainfuck, but with even fewer syntax elements).
How could I forget Whitespace? (HT Conor McBride)
Another good one is Piet, which uses graphics as programs, allowing programs in the style of Mondrian. Which in turn reminds me of this example of someone coding in Microsoft Paint. It’s all just numbers, underneath.
That’s superb.
Don’t forget Malbolge in which Hello world! is the following:
Interestingly enough it’s named after eighth circle of hell in Dante’s Inferno, which I happened to be reading at the weekend — cheerful chap that I am!