DEV Community

Cover image for 🎨 Piet — The Language Where Programs Look Like Modern Art
Pʀᴀɴᴀᴠ
Pʀᴀɴᴀᴠ

Posted on

🎨 Piet — The Language Where Programs Look Like Modern Art

What is Piet?

Piet is an esoteric programming language created by David Morgan-Mar in which programs are images rather than text. Instead of written instructions, Piet uses colored blocks arranged in a bitmap. Execution flows across the image, changing direction based on color transitions and performing operations depending on how colors shift in hue and brightness.

The language is named after the painter Piet Mondrian because valid programs often resemble abstract geometric art. A working Piet program can look like a digital painting rather than code. As a result, Piet blurs the boundary between programming and visual expression.


Specs

Language Type: Esoteric / Visual

Released: 2001

Creator: David Morgan-Mar

Execution Model: Image processing with directional control

Instruction Encoding: Hue + brightness transitions between color regions

Purpose: Artistic computation and unconventional logic


CODE EXAMPLE (Hello World)

Instead of text, a Piet program for "Hello World" looks like a colorful pixel grid. A simplified representation might be:

⬛🟥🟧🟨🟩🟦🟪⬛
🟥🟥🟥⬛🟩⬛🟪⬛
🟥⬛🟧⬛🟩⬛🟪⬛
⬛⬛⬛⬛⬛⬛⬛⬛
Enter fullscreen mode Exit fullscreen mode

(Real Piet code must follow strict color transition rules and cannot be represented perfectly in plain text.)


How It Works

  • The interpreter follows a “pointer” that moves across color blocks.
  • Each block of solid color is a command zone.
  • Operations are determined by:
    • Hue change (e.g., red → yellow)
    • Brightness change (e.g., light → dark)
  • White regions act as “tunnels” where direction is preserved.
  • Black regions act as walls.

This gives Piet a puzzling, maze-like execution structure where design and computation merge.


Strengths

  • Visually expressive — programs can look like art.
  • Unique approach to programming and computation.
  • Great for creative coding competitions and novelty design.
  • Encourages thinking in spatial and conceptual patterns instead of text.

Weaknesses

  • Hard to write and harder to debug without dedicated design tools.
  • Requires special editors or color grids to create valid programs.
  • Changes in colors or pixel alignment can easily break execution.
  • Not suitable for real-world development or maintainability.

Where to Run

Several Piet interpreters exist, including:

  • Online playgrounds
  • GitHub implementations
  • Pixel-based IDEs with color mapping helpers

TIO.run and community editors also support Piet execution.


Should You Learn It?

For real development: No

For artistic programming exploration: Yes

For programming puzzles and visual logic: Absolutely

For readable or maintainable code: No


Summary

Piet transforms programming into visual art by replacing text with color grids and pixel patterns. It stands as one of the most iconic visual esolangs — challenging traditional assumptions about code and forcing developers to think visually, spatially, and creatively. Piet remains a stunning example of how programming languages can also be canvases.

Top comments (0)