HeadlinesBriefing favicon HeadlinesBriefing.com

MNM Lang: A Programming Language Built Entirely From M&Ms

Hacker News •
×

What if a pile of M&Ms could actually run code? That's the question behind MNM Lang, a whimsical programming language where source code is written using candy arrangements. The project began when developer Arnav Mishra spilled a packet of GEMS (Indian M&Ms) on the floor, creating a pattern that sparked an unusual idea.

The challenge was building a language that worked with only six candy colors while remaining practical enough to actually execute. The solution encodes instructions by color family and operands by candy count - for example, RRRR represents the number 3 because it's len(token) - 1. This simple rule makes the language easy to author, render, and decode from images.

MNM Lang includes a CLI, browser playground, and example programs, with candy sprites generated using AI image generation. The system uses a clever two-part structure: visual candy layouts in .mnm files and runtime data in .mnm.json sidecars. This separation keeps the image format simple while allowing practical features like strings and variables. The result is a complete, working language that proves even the silliest ideas can have serious implementations - as long as you're willing to count candy.