Earlier quoted context omitted.
> * Zig's std lib data structures are incredibly useful, especially compared to the C++ STL. I think elaborating on this could make for a very interesting article. :-) (I have a guess already at one item, which is MultiArrayList, something that kind of blew my mind when I first learned about it, and is in my opinion a very impressive testament to both the power and ease of use of Zig's approach to compile-time comput…
I didn't even know about it until today, very impressive. Generic SoA in less than 500 lines of userland code... https://github.com/ziglang/zig/blob/master/lib/std/multi_arr...
Zig is now self–hosted by default
111–115 of 115 posts
Re: Zig is now self–hosted by default
#112Earlier quoted context omitted.
I didn't even know about it until today, very impressive. Generic SoA in less than 500 lines of userland code... https://github.com/ziglang/zig/blob/master/lib/std/multi_arr...
SoA in C++ isn't that long, here's my version (which for sure does not have the utility functions defined here though, but is useful enough for me): https://github.com/celtera/ahsohtoa/blob/main/include/ahsoht...
Zig's still got it beat handily in simplicity though -- I think what's really cool about Zig's idea of comp-time evaluation is you get something like the power of C++ with something like the simplicity of C.
Re: Zig is now self–hosted by default
#113Earlier quoted context omitted.
The fact that constant-folding is hard because the C language doesn't have portable semantics for basic things like integer addition (with overflow) is just braindead.
Yes, there are lots of optimizations that are hard in C and only possible thanks to UB abuse.
Re: Zig is now self–hosted by default
#114Earlier quoted context omitted.
> Zig produces smaller, faster binaries than C++ This seems fairly significant to me and makes me wonder how this is possible with all the effort that has gone into optimizing C++
Because they can't do breaking changes and must live with legacy baggage. While zig can work use modern techniques without such issues
Re: Zig is now self–hosted by default
#115Earlier quoted context omitted.
Because they can't do breaking changes and must live with legacy baggage. While zig can work use modern techniques without such issues
This is wrong because you can strip out C++ code you don't need. Green code doesn't need to worry about legacy baggage
Which is used all over the world?