Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The metaprogramming available in languages like Rust and C++ could maybe be leveraged to make the struct-of-arrays model easier. Wouldn't be the same as native support, though.


Julia has a package that provides incredibility easy to use SoA. https://github.com/JuliaArrays/StructArrays.jl Julia's metaprogramming and multiple dispatch mean that it can use user structs fully transparently. Everything just works.


I've seen this done in D fairly easily, almost definitely closed source unfortunately.


There is some, lets call them experimental, C++ libraries for that. But C++ not having static reflection is the main show stopper on that frontier.


> There is some, lets call them experimental, C++ libraries for that.

Could you provide some links?


https://github.com/Yamahari/struct_array

It uses C++20 features and macros. The macros limit it to a POD count of 8.


Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: