News for hackers. Stuff that matters.
Re:Sample programs in the Piet programming language by greenpenguin on Wednesday March 23, 2016 @06:29AM (#11343258)
I had an interesting time writing a JIT for Piet some time ago. Piet is a pretty weird language in a few non-obvious ways. From what I remember:

* Execution moves between blocks of colour. Flood fill algorithms are a valid compiler optimisation!

* Execution can move left/right/up/down. You can't necessarily tell what will be executed without doing it. The 'codel chooser' stuff means you can exit a colour block in two different ways depending on program state (plus left/right/up/down, so 8 ways total...).

* Instructions are encoded in the difference between colour blocks.

* Piet is otherwise a fairly straightforward stack machine.

There are no comments on this comment yet.