4 ms·
Yeah, I’m leaning towards zig but I’m a bit on the fence still. For Rust, I kind of got tired of writing unsafe rust for embedded, but that’s addressable afaik
by davemp 2y ago
Yeah, I’m leaning towards zig but I’m a bit on the fence still.
For Rust, I kind of got tired of writing unsafe rust for embedded, but that’s addressable afaik. The real dealbreaker was that after 10k+ lines of code I still will pop open the source of a library that solves a simple problem and the code looks indecipherable. I also don’t really agree with the dependency explosion that cargo encourages.
Zig is very nice in that it has the most ergonomic struct usage I’ve encountered. The stdlib could really use some improvement though. Comptime is very cool, but I also worry if the community will get undisciplined with it.
- angra_mainyu 2y agoZig is fantastic, however there are a few issues (mostly related to its immature/wip status): - the build system is constantly changing in a breaking way (between releases some of the repos I have on GH no longer build and need their build.zig to be updated). - the comptime section of the docs needs to be heavily expanded, I'd love to see them take common Go interfaces and redo them in Zig (like io.Writer, io.Reader), breaking down the process step-by-step. It took me a little bit longer than it should've to efficiently use comptime. - a whole section dedicated to things like using WaitGroup and multithreading, for those coming from langs like Go. Also, higher-level concurrency primitives like channels would be fantastic. - a better import system for external zig libraries, the zig fetch => .dependency => .root_module.addImport stuff is not as straightforward as it should be although for someone coming from C it definitely does feel like using meson None of these are critical and again, all signs of Zig's "youth".
- DeathArrow 2y ago>Also, higher-level concurrency primitives like channels would be fantastic. That can be done trough a library.
- angra_mainyu 2y agoAgreed! There is actually a nice C library (libdill: https://libdill.org https://libdill.org). Would still like it as a first-class language construct.