3 ms·
This particular example is machine-generated code created by translate-c, it's meant to be semantically equivalent to the C code and even uses language features
by kristoff_it 5y ago
This particular example is machine-generated code created by translate-c, it's meant to be semantically equivalent to the C code and even uses language features that you're normally not even supposed to use (c pointers).
Reasonable Zig code looks more like this:
https://github.com/riverwm/river/blob/master/riverctl/main.zig https://github.com/riverwm/river/blob/master/riverctl/main.z...
That said I think it's fine if you don't like the syntax. I think that some complaints are honestly too superficial to be legitimate (like complaining about builtins being prefixed with @), but at the same time Zig is often times prioritizing explicitness over "good looking".
I personally consider Swift a very good looking language, but then I look at all the new features that got added since I used it last, remember that I value simplicity over aesthetics, and go back to Zig.
- dragonelite 5y agoOoh that looks a bit like Rust having quickly scrolling by. I have been keeping a eye on Zig but I'm waiting till the package manager stuff has been finalized and implemented.