A package I’m building needs a datastructure that has properties of both structs and arrays. I’m not totally across all of the options and their relative speed or type stability. I’m currently using axis arrays and various mutable structs, but neither feels quite right. I may not quite grasp where the boundaries are on what is technically possible, but this is the wish list:
- Fields have get and set methods with fast integer indexing at run time, like arrays.
- The same fields also can be accessed with symbols, mostly at compile time, in 1 and 2 dimension - with little or no overhead.
- The field names needs to be part of the type - to alow method specialisation based on fields, like structs. I think static arrays can do this based on array length, but also using the symbols is the key.
- The largest array size that I need is around 10 * 10.
- And of course it needs to run really fast.
Does this exist?