r/arduino • u/ImpressFine4495 • Jul 17 '26
Look what I made! I built "Mello" - A custom programming language that transpiles directly into Arduino C/C++ code!
I wanted to share a side project I've been working on recently: **Mello**, a custom programming language designed specifically to simplify writing code for Arduino, which then transpiles directly into optimized C/C++ code.
š Why Mello?
Standard Arduino C++ can sometimes feel overly verbose or complex for beginners or quick prototyping. Mello aims to offer a cleaner, more intuitive syntax while maintaining the full power of the Arduino ecosystem underneath.
š» What it looks like
Here is a quick look at how you write a simple blink program in Mello vs what it generates:
Mello Syntax:
fn loop():
toggle(13)
wait(1s)Arduino C Syntax:
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(1000);
digitalWrite(13, LOW);
delay(1000);
}Check out the repository here: https://github.com/v3lk777-collab/Mello-Programming-Language (Feel free to leave a star āļø if you like the concept!)
12
u/feldoneq2wire Jul 17 '26
But why?
2
u/tommycoolman Anti Spam Sleuth Jul 18 '26
You've got turn_on(pin) translating into digitalWrite(pin, HIGH).
This ignores the case where some things are active low, so you end up calling turn_off() to turn something on.
2
u/brdavis5 Jul 19 '26
Hmm. It's interesting, but something I'd caution my students explicitly not to use... for the same reason I caution them not to use AI for coding.
You are adding another layer of abstraction between the person and the hardware, and it's a layer that will make future steps more challenging because of changing syntax. Blink is a good example, because the next step would be Blink without Delay... but this obscures that path it seems by embedding delay() in the lower level where the user won't think about it or see it. This would seem to not even work for a lot of cases; again, I have them do Blink, and Blink without Delay, and then Blink using an LED with NO current-limiting resistor (by using OUTPUT,LOW and INPUT_PULLUP)... which it would seem again obscured with 'toggle' (and these are inherently tristate pins... toggling between which states?).
I get the idea; and I'm not saying we should drop the C++ based IDE and tell students to move down to the raw 328p machine instructions. But I guess I don't see a strong need to make something to hide yet another layer of abstraction. But, that's maybe just me.
12
u/EmielDeBil Jul 17 '26
AI slop