Piet (programming language)
![]() | The topic of this article may not meet Wikipedia's general notability guideline. (February 2011) |


Piet is an esoteric programming language designed by David Morgan-Mar, whose programs are bitmaps that look like abstract art. The compilation is guided by a "pointer" that moves around the image, from one continuous coloured region to the next. Procedures are carried through when the pointer exits a region.
There are 20 colours for which behaviour is specified: 18 "colourful" colours, which are ordered by a 6-step hue cycle and a 3-step brightness cycle; and black and white which are not ordered. When exiting a "colourful" colour and entering another one, the performed procedure is determined by the number of steps of change in hue and brightness. Black cannot be entered; when the pointer tries to enter a black region, the rules of choosing the next block are changed instead. If all possible rules are tried, the program terminates. Regions outside the borders of the image are also treated as black. White does not perform operations, but allows the pointer to "pass through". The behaviour of colours other than the 20 specified is left to the compiler.
Variables are stored in memory as signed integers in a single stack. Most specified procedures deal with operations on that stack, others with input/output and with the rules by which the compilation pointer moves.
Piet was named after the Dutch painter Piet Mondriaan. The originally intended name, Mondrian, was already taken.
External links
- Piet programming language
- Piet on the esolangs wiki
- A Piet program with detailed explanation
- A Piet program that looks like a painting by Piet Mondrian
- Piet::Interpreter - An interpreter for Piet written in Perl
- npiet - An interpreter and editor for Piet
- PietDev - An online Piet editor and debugger
- 99 bottles of beer on the wall
- - A cross platform debugger and development GUI tool for Piet