Hacker News new | past | comments | ask | show | jobs | submit login

I got this working on a RPi 2040 during my most recent microcontroller phase several months back. I know Zig can be oddly divisive here on HN but can we at least agree that it's a good thing to have alternatives to Python in this space?



In the microcontroller space, I think Zig is more of a replacement for C/C++. It's a compiled language, intended to produce optimized code that hits cost/performance targets.

Micropython and friends are well-suited for education/hobby use, protoptyping, and maybe some commercial applications that aren't sensitive to cost or realtime characteristics. But since they don't really compete with C/C++, they also don't really compete with Zig.


You're right of course, but if you pick up a 2040 and you're a newbie to microcontrollers (as I am), all of the documentation and first-party tools push you towards using Python, which I've never been too fond of and I started looking for alternatives as soon as I finished the last chapter of the manual. The alternatives are always there but they presume a level of experience (and C skills) that I just don't have. Having experimented with Zig I was glad to eventually find MicroZig. I remember that using it wasn't quite as easy as "push button, watch LED blink" as it was when I was using Python and Thonny but if a n00b like me could figure it out, anyone can.


it's true that micropython doesn't compete with zig, but zig is simple enough/no-fuss enough (imagine deployment strategies baked with one line in a build.zig) that it might compete with micropython.


BASIC, Pascal have been doing it for decades already, to the point the likes of Mikroe and Parallax don't have any issue staying in business selling compilers.


Agreed! I’ve similarly had good experiences with Rust on the rp2040, using embassy which builds on the rust HALs.


God, yes. Ruby is also at least somewhat usable in the space, FWIW; I've done RPi hacking with it in the past.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: