News for hackers. Stuff that matters.
Re:MicroZig: Unified abstraction layer and HAL for Zig on se... by Cyberdog on Wednesday February 28, 2024 @12:56PM (#39541443)
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?
Re:MicroZig: Unified abstraction layer and HAL for Zig on se... by nrclark on Wednesday February 28, 2024 @01:20PM (#39541754)
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.

Re:MicroZig: Unified abstraction layer and HAL for Zig on se... by throwawaymaths on Wednesday February 28, 2024 @01:29PM (#39541872)
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.
Re:MicroZig: Unified abstraction layer and HAL for Zig on se... by Cyberdog on Wednesday February 28, 2024 @02:09PM (#39542312)
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.
Re:MicroZig: Unified abstraction layer and HAL for Zig on se... by pjmlp on Thursday February 29, 2024 @02:26AM (#39547129)
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.
Re:MicroZig: Unified abstraction layer and HAL for Zig on se... by jakewins on Wednesday February 28, 2024 @01:51PM (#39542120)
Agreed! I’ve similarly had good experiences with Rust on the rp2040, using embassy which builds on the rust HALs.
Re:MicroZig: Unified abstraction layer and HAL for Zig on se... by KerrAvon on Wednesday February 28, 2024 @02:52PM (#39542687)
God, yes. Ruby is also at least somewhat usable in the space, FWIW; I've done RPi hacking with it in the past.