Settings

Theme

I made a programming language with M&Ms

mufeedvh.com

104 points by tosh 21 hours ago · 39 comments

Reader

mufeedvh 17 hours ago

Author of this silly project here!

Sharing a bit of backstory on why I decided to work on this; Firstly, “for fun” but primarily because I felt like I started losing the childlike wonder/whimsy I once had with programming.

So I started this new hobby where I ask myself “can I hack on this?” upon getting/seeing something.

For instance, I got this new Aula F75 keyboard (really good keyboard for the price btw, it sounds good too!) and it only has dedicated control software for Windows. So I downloaded the driver files, software executable, and manual sheet and reverse engineered the full protocol/packets and rebuilt it for my Mac. Then played snake with the backlights. Fun.

Anywho, happy to see my blog on the front page. Would love to hear if anyones going through something similar or working on silly little projects! :)

  • AdieuToLogic 13 hours ago

    Great post, thanks for sharing it!

    When I saw the title, I thought of Lambda Calculus[0] and SKI combinators[1]. Given that there are "only six useful colors", I wonder if M&Ms could be used to implement them.

    0 - https://en.wikipedia.org/wiki/Lambda_calculus

    1 - https://en.wikipedia.org/wiki/SKI_combinator_calculus

  • berlinquin 14 hours ago

    Fun project! I had a similar project a while back, but my medium of choice was the Uno card game. I called it UnoScript [1] and it had similar mechanisms as color was an important factor. I also ended with a stack as the main part of the language, where different colors/combinations of cards could read from/modify the stack. Interesting how similar constraints can lead to some similar design choices!

    [1](https://github.com/berlinquin/UnoScript)

  • pkaral 11 hours ago

    This makes the world a better place. I got a little oxytocin hit just from the thought that somewhere on this world, someone is working on this problem. Now I'll be kinder to old ladies and give those poor puppies a pass.

  • chocochunks 17 hours ago

    Does this work with real candy?

    • mufeedvh 14 hours ago

      Yes! Just make sure to take a photo on a plain white surface is all.

      With:

        uv run mnm decompile path/to/photo.png --mode photo
bronlund 19 hours ago

It’s funny until one guy spills his bag of M&M’s and accidentally deletes the production database.

Timwi 7 hours ago

Will read this later, but in the meantime, if you're into “physical programming”, check out efghij: https://esolangs.org/wiki/Efghij

amelius 17 hours ago

What color is your function?

  • spaqin 13 hours ago

    That's one language that doesn't need an external IDE for syntax highlighting.

rhoopr 3 hours ago

Looking forward to the first LLM&M coding agent

xnorswap 5 hours ago

I can't see it explained, why/where is 000000 defined as newline?

MASNeo 8 hours ago

Thank you.Awesome project!

Unfortunately I think you have given my kids one more hard to refuse reason to get more candy: I need more storage.

swaraj 11 hours ago

This is what HN is all about

bigstrat2003 17 hours ago

It's all fun and games until some fat bastard like me decides he wants a snack. Incidentally, which flavor? Asking for a friend.

filozopdasha 14 hours ago

it actually sounds like a fun idea, but i have one question. do you think a lightweight CNN trained on synthetic candy layouts would outperform the deterministic decoder for messy real world photos?

  • mufeedvh 10 hours ago

    Yes, for messy real-world photos a lightweight CNN would probably outperform the deterministic decoder, but I’d still use it in a hybrid pipeline with classic CV for blob detection and deterministic logic for reconstructing the actual program.

tapeloop 2 hours ago

but can it run Doom?

Surac 7 hours ago

oh man the program just melted in my mouth

nathaah3 9 hours ago

this is so cool!

MostlyStable 8 hours ago

Not really the same, but made me think of this classic xkcd: https://xkcd.com/505/

owyn 19 hours ago

This is AI slop but mildly amusing. Brainfuck did it first.

  • ramon156 16 hours ago

    Which part made you conclude there's AI involved?

    • owyn 13 hours ago

      the bold section headers and bullet points. but who cares. i don't.

      • 306bobby 12 hours ago

        I literally write like the article on similar write ups, where do you think the AI's learned to write this way from.

        I really don't get the AI vibes from the actual writing of it

        • willwade 8 hours ago

          It gave me strong vibes too. It’s the writing style. I’ve seen OpenAI write just like this. Doesn’t mean it’s bad. There’s a few other markers. Note “silly” in quotes and over use if that word. Once would be enough. But also this is very very typical. The bolting and short quite direct and a bit repetitive statements “it absolutely does not solve “dumped a bag of candy on a messy kitchen table and took a dramatic iPhone shot.”

          Real example programs are where the joke becomes a language I didn’t want this to stop at “hello world with candy colors.”” The over use of quoting. The bold. It’s not like a human wouldn’t write this. But it’s unusual for a human to do this imho. All the same - it feels novel. And at the end of the day it’s a neat idea. It’s just we enter this new brave world where things written like this give you the ick. “Where do the ai learn this from?” Well I wouldn’t mind betting the author asked it to be written in a hn style post.

          • NetMageSCW an hour ago

            You have a problem. I would suggest thinking about it.

          • Timwi 7 hours ago

            Please re-read your comment and tell me you're not grasping at straws just to accuse someone of using AI to write.

      • Timwi 7 hours ago

        Are you serious? We can't make headers bold or use bullet points anymore without people like you instantly calling it AI slop?

avatardeejay 15 hours ago

Am I allowed to use the term psychopath in the most loving, even inspired, way?

  • dang 14 hours ago

    Psychopath implies lack of empathy so I don't think that's quite the word you want. You could maybe repurpose "psychotic" though!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection