←back to thread

228 points Retro_Dev | 1 comments | | HN request time: 0.341s | source
Show context
blippage ◴[] No.44462083[source]
I tried Zig some time ago to use with microcontrollers. It has a generator for the pins, which was nice. But subsequent versions broke as Zig changed syntax. So I started going down the rabbit-hole (it needed a newer version of llvm, for example) until I eventually decided that the game wasn't worth the candle.

The fact that another breaking change has been introduced confirms my suspicion that Zig is not ready for primetime.

My conclusion is to just use C. For low-level programming it's very hard to improve on C. There is not likely to be any killer feature that some other contender will allow you to write the same code in a fifth of the lines nor make the code any more understandable.

Yes, C may have its quirky behaviour that people gnash their teeth over. But ultimately, it's not that bad.

If you want to use a better C, use C++. C++ is perfectly fine for using with microcontrollers, for example. Now get back to work!

replies(10): >>44462098 #>>44462163 #>>44462194 #>>44462322 #>>44462409 #>>44462430 #>>44462780 #>>44463127 #>>44463517 #>>44464834 #
1. scrubs ◴[] No.44463517[source]
Well, that's a sentiment I don't quite agree with. It willfully ignores industry experience with c/c++ whence zig, rust, D, and others.

If your micro controller is say <5000 lines maybe ... but an OS or a mellanox verbs or dpdk API won't fall so easily to such surface level thinking.

Maybe zig could help itself by providing through llvm what Google sometimes does for large api breaking changes ... have llvm tool that searches out old api invocation update to new so upgrading is faster, more operationally effective.

Google's tools do this and give the dev a source code pr candidate. That's how they can change zillions of calls with confidence.