Skip to main content

Piet - an esoteric programming language

There’s a certain group of programmers out there that like to come up with programming languages just for the fun of it. Some of them have profanity as their names, and some are based on internet memes. Whatever the case may be, some individual out there enjoyed thinking up the language, and many of these languages are actually useable.


One esoteric language that stands out, for me, at least, is Piet, created by David Morgan-Mar. Based on the idea of making programs that look like abstract art, Piet allows the programmer to express their software in the form of coloured blocks. Numbers are represented by blocks of pixels containing a pixel count equal to the number itself. Operations are performed by changes in hue or darkness.


As an example, here is a Piet program I wrote to output the string “Hello World”. This image is in fact the entirety of the program, and can be run in any of the Piet interpreters out there. Other examples of Hello World programs are available on David’s site, as well as some other programs cooked up by Piet enthusiasts.


One property of a programming language is that it can be Turing-complete. What this means is: can the programming language be used to solve any arbitrary computing problem? In fact, extra kudos go to those esoteric programming language creators who create one that is Turing-complete.


It is believed that Piet is Turing-complete, but as of yet no one has stepped forward to implement a program to test this. However, given a stack of unlimited size, a reasonable interpreter for the language Brainf*ck could be implemented. Brainf*ck itself has been proven to be Turing-complete, and since Turing-completeness is transitive, a programming language that can interpret a Turing-complete language can be said to be Turing-complete as well.


Piet can be used to produce some functional, beautiful pieces of software, and it definitely piqued my curiosity when I first found out about it. Maybe you’ll find it interesting too, maybe you’ll write something in it, maybe you’ll join the discussion forum. Whatever the case may be, it’s one language that definitely has something special going for it.

Comments

Popular posts from this blog

Am I Jonesing for the Internet?

I’m feeling a little agitated and jittery today. My internet access is down due to some nasty snow and wind. Are the two related? They might be. I know I’m certainly missing my twitter friends and feeling less in touch with the world. How long is this weather going to hold? I can’t look that up. Sure, I could pull out a radio and listen in, if I had one. I might somewhere, but I’m at the mercy of the broadcaster to decide when to report the weather and how much of it to report. Some argue that internet access should be a basic human right. Does this point of view hold water? I suppose it could be argued that since the internet allows us to draw together into a larger community that it is an essential part of improving the human condition. Its use in political organizing and to connect dissidents in repressive regimes can certainly help make the case for it as a basic human right. Is the jitteriness really from not having the internet? My doctor did just increase my dose of modafi...

Interactive Fiction - Finding the Mouse

For as long as I’ve been using computers I’ve known of text adventures. Using your imagination and the words on the screen, you construct a world in your mind and then interact with it through the computer by typing in commands. The goal is usually to solve different puzzles in order to come to some sort of winning scenario. Nowadays text adventures have given way to interactive fiction, or IF. Much like text adventures, there is often a goal to reach. However, some can be entirely freeform and offer the reader a variety of scenery and possibilities to explore. They still stick to text as their means of communication and rely on the reader to imagine the scenery. There’s still usually some sort of puzzle to solve, and this can provide a lot of fun for some. The interactive fiction community is still going strong. There are plenty of archives out there for the curious reader to explore; the most prominent being the IF Archive . There’s a newsgroup at rec.arts.int-fiction (Google Groups...