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

Living with Bipolar Disorder

Feeling down when something bad happens is normal. Feeling elated when something good happens is great. Bipolar disorder is neither. Previously referred to as manic depressive disorder, bipolar disorder consists of mood episodes ranging from deep, dark depression to the sense of invincibility and superiority that is characteristic of a manic phase. It disrupts the lives of those who suffer from it and all those around them. Luckily, however, with the right course of treatment it can be kept under control. Bipolar disorder has been found to be linked genetically and physiologically to schizophrenia. A person suffering from bipolar disorder can experience the same sort of hallucinations and delusions as someone with schizophrenia. Both have a genetic component, with a number of genes interacting to create a pre-disposition to these disorders. The families of those afflicted often include others with one of these disorders, mood disorders or alcoholism. Depression is a common symptom ...

Losing a loved one, as an atheist

When I was around 11 or 12, I started to question the received wisdom that there was a deity. I came to the conclusion that all signs pointed to no. Do I outright, unequivocally and without reservation deny the existence of such an entity? No. However, I don’t see it as a likely scenario, and until I’m presented with hard evidence, I have enough reason to say that there isn’t. Some people take comfort in their religious beliefs, especially their belief in an afterlife. I have no interest in an afterlife, either for myself of my loved ones. In the past five years I’ve lost both my grandmother and mother, both of whom I loved dearly. No amount of belief in an afterlife would soothe my pain. I mourn at the fact that they are lost from my life, right here, right now. I imagine it’s the same even for those who believe that the dead pass on to somewhere else. You can’t escape the fact that their tangible presence is forever gone from your life. Unless you believe in ghosts, but that’s a ...

If I Grow Up

I’ve figured out what I want to be if I grow up: a writer. In fact, by writing this I’m living the dream, aren’t I? I guess things have been building up to this my whole life; I’ve been reading since I could, and writing even when I didn’t have to. Whatever my mood has been, as long as it wasn’t too severe, I’ve always written. When I was down, I wrote depressing poetry or prose. When I was up, I wrote whatever popped into my head. Now that I’m stable, I can take the time to write coherent, sensible articles. What are you going to write? It’s a good question, and I like it quite a bit. I’m going to write articles here, like the ones I’ve written so far. I’m going to write for HandmadeNews.org , with my first article there out just recently. I’ll always be writing emails. Sometimes I’ll write things down in my notebooks. If I feel like my writing is worthy of it, I might write a screenplay Josh Olson would enjoy reading. I wont bring it to him to read, though. If it’s good enough ...