3 ms·
That is called a "struct of arrays" (vs an "array of structs"). https://en.wikipedia.org/wiki/AOS_and_SOA https://en.wikipedia.org/wiki/AOS_and_SOA I don't kn
by IshKebab 8y ago
That is called a "struct of arrays" (vs an "array of structs").
https://en.wikipedia.org/wiki/AOS_and_SOA https://en.wikipedia.org/wiki/AOS_and_SOA
I don't know of any language that transparently supports it other than Jai, which isn't available yet.
https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md#data-oriented-structures https://github.com/BSVino/JaiPrimer/blob/master/JaiPrimer.md...
- tjalfi 8y agoJovial 73 has built in support for SoA arrays.
- Tarean 8y agoHaskell's "unboxed" vectors do this on a library level so `Vector (a, b)` is stored as `V_2 {-# UNPACK #-} !Int !(Vector a) !(Vector b)`. But to implement it for new types you need some boilerplate. Alternatively you could use template haskell or cpp to generate the boilerplate, though. The default instances use cpp https://github.com/haskell/vector/blob/master/internal/unbox-tuple-instances https://github.com/haskell/vector/blob/master/internal/unbox...