The Sweetest Programming Language: MNM

Admit it. If you haven’t created your own little programming language, you’ve probably at least thought about it. [Muffed] decided to create a unique — and sweet — programming language that uses M&M (or, at least, M&M-like) candies as the building block of programs.

If this sounds strange, it is because, honestly, it is. It all started when a packet of GEMS (the Cadbury’s version of M&Ms)  spilled and randomly fell in the shape of an arrow. There are only six symbols corresponding to the colors in a package. You create your program by arranging the candies and creating a digital image of the result. In practice, you’ll probably use ASCII text to represent your candy layout and let the compiler render the image for you.

The main way of encoding things is by the number of colored candy pixels in a row. So three blue morsels in an opcode, while four is a different opcode. Red candies encode integer literals with one candy being zero, two being one, and so on. Blue indicates control flow, green candy handles variables and stack operations, yellow is for math, and so on.

Since building things like strings. So, sadly, the M&M program isn’t complete without a run-time data file in JSON format. The title graphic shows a Hello World program that you can run in the web page, but it doesn’t show the JSON file. That’s here:

{
   "strings": ["Hello, world!"],
   "variables": [],
   "inputs": {
      "int": [],
      "str": []
   }
}

We don’t know of any other language where you can literally eat your mistakes. There’s something to be said for that. If you want to try it, you can just write over one of the examples on the web page. Or download from GitHub.

We have seen graphic input languages before. Plus many other weird languages.

14 thoughts on “The Sweetest Programming Language: MNM

  1. This is so incredibly creative! Using different colored M&Ms for opcodes and variables is just brilliant (plus, the fact that you can literally eat your “bugs” if you make a mistake is hilarious 😂). Seeing the Hello World demo, this kind of color-pixel-based graphical programming language is really inspiring.

    However, if you’re rendering and debugging this on a digital device, screen color accuracy becomes pretty crucial so you don’t accidentally mix up your opcodes! As someone who works with screen hardware all the time, I regularly test different LCD panels and modules over at LCDSell, and I can’t help but think how stunning this color-coded “candy logic” would look on a high-gamut, color-accurate display.

    Thanks for sharing such a fun and unique esoteric language! Definitely heading over to GitHub to download it and give it a spin.

  2. Instead of creating new languages all the time, why not teach people how to program properly with what we have. That is the whole underlying issue. C/C++ covers everything, and when used properly simply just works.

      1. Do you think it’s possible to create a programming language that uses song. I would think that something vocal would have a lower learning curve. I had seen someone invent a programming language that uses poetry.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.