NumericArrays are unrelated to packed arrays.
"Packed array" refers to an internal efficient storage format used for
Lists. There is no such head as
PackedArray. Normally, packed arrays are not observable. Their usage is completely transparent. The only way to tell that a
List is packed is either by performance measurements or by using some special developer functions (such as
NumericArrays are an expression type in their own right.
NumericArray basically just provides a space-efficient and exact storage format. On a typical modern system, Mathematica stores both machine integers and machine reals in 64 bits. Even if you use
BinaryRead to read a file byte-by-byte, 64-bits will be wasted for storing each byte. Clearly, 8 bits would be enough.
NumericArray enables that, not only for bytes, but for all typical integer and floating point formats.
NumericArray is not really useful for computation at this point. It is useful as an exchange format. It can wrap raw arrays in C, so it is useful with LibraryLink. There's a LibraryLink API for it in M12.0. It can be serialized to WXF, which is partially used by
ExternalEvaluate to communicate with Python. It appears in the InputForm of
Audio, thus serializing these atomic expressions into a compound one will not waste any space.
If you want to do computations, you'd do one of the following:
Extract the values from the
Normal (and thus increase the memory usage)
Put it in a computable format like
As a special case, neural net functions handle numeric arrays efficiently. You can give one as input to e.g. a linear layer and get another one as output.
Write your own functions in C to handle them (LibraryLink). It is a convenience for C programmers to use NumericArray because now they can choose their own data format and have Mathematica adapt to it, rather than having to adapt to Mathematica's format.
Perhaps in the future more functions will handle numeric arrays without needing to extract data from them.
NumericArray did exist in previous versions in the form of the undocumented
RawArray. I believe these are the same thing as the LibraryLink RawArray API works with NumericArrays and vice versa. Also, old RawArrays now always appear as NumericArray in M12.0. The syntax of
NumericArray is slightly different from the old