SCUA

News

Arrays went unboxed, automatically

August 10, 2026

Plain arrays of numbers now store their elements unboxed. An array that has only ever held integers, or only floats, keeps them in a packed 8-byte layout: half the memory, and substantially faster hot loops. Int-array workloads run up to about twice as fast, and float loops additionally vectorize where the hardware supports it.

The word doing the work in that paragraph is "automatically". You declare nothing. The array notices what it holds on first push, and if you later mix in a value of another type it converts back to the general layout, once, seamlessly. Code that was already correct stays correct and just gets a faster representation underneath.

Two guarantees we held while doing it. { f64 }-style typed buffers are unchanged and remain the way to demand a packed layout rather than merely receive one. And saved partitions round-trip packed arrays exactly, including full 64-bit integer precision, because a faster representation that leaked into snapshot bytes would break the language's central promise.