Developer spills candy on the floor, invents a programming language

MNM Lang compiles source code into a PNG image made of candy sprites. Each program is a grid of M&M-style tokens — six colors, each mapped to a family of instructions — and you can round-trip the image back to executable source without losing anything. A built-in decoder can even reconstruct programs from overhead photos of real candy, provided the pieces are spaced apart on a plain background.

Developer Mufeed VH built the language after dumping a packet of GEMS (an Indian M&M equivalent) and noticing the colors landed in what looked like an arrow, he writes. Six candy colors became six instruction families — control flow is blue, variable operations are green, arithmetic is yellow, printing is orange, labels are brown, and logic is red. How many candies you string together picks the specific operation — BBB is one opcode, BBBB is another — and integer literals work by count minus one, so four red candies represent the number 3.

Strings get their own sidecar JSON file rather than being crammed into the image, because, as Mufeed puts it, "candy OCR is a terrible life choice." The candy sprites themselves were generated with AI image tools and then normalized onto a 128×128 canvas. Working examples in the GitHub repo include Hello World, factorial, and Fizz Buzz — all rendered as colorful candy grids. There's also a browser playground with an AST viewer and execution trace that shows every branch decision the program makes.

Previously: