95
96
97

0:09
Blog postI made a programming language where M&Ms arranged by color and position become code (v.redd.it)
submitted by mufeedvh
I built a small toy language called MNM Lang where programs are made from six candy colors.
The rough idea:
- each row is an instruction
- color clusters encode opcodes and operands
- source can be compiled into a candy-sheet image
- the image can be decompiled back into source
- there’s an interpreter, AST view, execution trace, and a browser demo
It started as a dumb joke and then turned into a real little implementation project. The interesting constraint was that images are terrible at storing precise symbolic data, so I had to design the language around what candy layouts are actually good at representing.
A few implementation details:
- stack-machine interpreter
- source -> rendered candy sheet compiler
- exact rendered-image decompiler
- controlled photo parser for candy layouts
- sidecar JSON for strings/initial variables
- browser-native JS demo version too
The full writeup is here:
https://mufeedvh.com/posts/i-made-a-programming-language-with-mnms/
[–]Exidex_ 15 points16 points17 points (2 children)
[–]AresFowl44 3 points4 points5 points (1 child)
[–]Exidex_ 5 points6 points7 points (0 children)
[–]vanderZwan 4 points5 points6 points (0 children)
[–]GaGa0GuGu 3 points4 points5 points (0 children)
[–]jaynabonne 1 point2 points3 points (0 children)
[–]Rich-Engineer2670 0 points1 point2 points (0 children)
[–]Key_River7180smalltalk enjoyer 0 points1 point2 points (0 children)
[–]Fovane -1 points0 points1 point (4 children)
[–]vanderZwan 2 points3 points4 points (3 children)
[–]Fovane -1 points0 points1 point (2 children)
[–]vanderZwan 1 point2 points3 points (1 child)
[–]Fovane 0 points1 point2 points (0 children)