That would be great! I don’t believe StaticArrays.jl has this:
These store a certain number of elements inline, and fall back to the heap for larger allocations.
I.e. it’s meant for small statically sized arrays (unless I missed something or some types were added later that I overlooked; or to another package, then I would really like to know). C++ has similar to Rust, in LLVM, named SmallVector, I believe. It’s mutable, and if you try to enlarge (over some size-limit I guess), then all of it goes to the heap. I don’t believe some small prefix stays on the stack or is cached there. For simplicity I would do either or, though I’m thinking of doing a string type where a prefix is cached… so it might be a nice option. One other thing, arrays are mutable in Julia. Is there a way to have immutable? I would like such an array to be mutable, e.g. when on the stack, and when on the heap, when you’re the only user, but allowing for marking it immutable/frozen.