A minimal interpreter for the esoteric programming language Piet written from scratch, in C.
Piet is a stack based language designed by David Morgan-Mar, in which programs are bitmaps that look like abstract art. Named after Piet Mondrian. Here is the official spec sheet.
Checkout what more creative people than me have been able to make with Piet.

A very cool "Hello World" program

This is an entire interpreter for another esoteric language, Brainf*ck
Piet is turing complete, even though it is as unwieldy as it gets.
Written in C, very minimal thanks to how few instructions there are in Piet. It just has five moving parts.
- Image loading: takes a ppm image with whatever bloat it might come with and loads it into memory after cleanup.
- Downsampling: Adjust for codel size.
- Mapping: Uses BFS to define all the colorblock and edges in the program. A traditional language would call all these steps tokenizing.
- Direction calculations: Exactly as it sounds. Decides the direction of program execution.
- Execution: Translates the color transitions into operations and execute them on the stack.
- Compile with make
make- And run! There are a few sample ppm files in the directory. They all have
codel-size = 1so ignore that flag.-vif you want block and step info.
./pietvm [-v] <image.ppm> [codel_size]- Approximate color matching rather than demanding exacts.
- png-to-ppm converter builtin
