4 ms·
> * 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 arti
by dilap 4y ago
> * 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 computation.)
- sekao 4y agoI 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_array_list.zig https://github.com/ziglang/zig/blob/master/lib/std/multi_arr...
- jcelerier 4y agoSoA 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/ahsohtoa/ahsohtoa.hpp https://github.com/celtera/ahsohtoa/blob/main/include/ahsoht...
- dilap 4y agoThat's pretty sweet, I didn't know C++ could do this now! 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.