Implementing a Struct of Arrays (C++26 compared to Zig)

EDIT: Just want to clarify that I’m not the author of the post I linked.

6 Likes

Very interesting blog post and clean implementation!
I think it’s always interesting to get the perspective of a C++ person on Zig and vice versa (especially when it comes to resource (de-)initialization and templates, how C++ does it is frankly mind-boggling to me).
Although I’ve admittedly never written a single line of C++ in my life I’ve read thousands of lines of it by now (just because there’s so much C++ code out there) and still every time I read a piece of C++ code I discover a bunch of new language features/stdlib functions it really is amazing :upside_down_face:

How do you feel about using data oriented design with C++ in general? Does the language facilitate it or does it make you jump through hoops to get there?

EDIT: scratch that I assumed that you were the author of the blog still interesting post!

c++ gets more and more rust like every time i see it

This makes total sense. Rust takes two big ideas of C++, type-driven template behavior parametrization and RAII, and brings them to the logical conclusion: monomorphisation-based trait system with emphasis on high-order functions, and the borrow checker.

1 Like

I know why c++ is becoming crab, I just think it’s amusing