News for hackers. Stuff that matters.
Re:Zig is now self–hosted by default by dilap on Saturday August 20, 2022 @12:28PM (#32533216)
> * 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.)

Re:Zig is now self–hosted by default by sekao on Saturday August 20, 2022 @01:27PM (#32533704)
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...

Re:Zig is now self–hosted by default by jcelerier on Monday August 22, 2022 @03:01AM (#32548208)
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...
Re:Zig is now self–hosted by default by dilap on Monday August 22, 2022 @11:56AM (#32553280)
That'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.