A seemingly basic question here.
Is there anything you can do with multidimensional arrays that you can't do with nested arrays?
Many languages have been designed with both facilities and syntactical differences, but I can't for the life of me work out what you can do with multidimensional arrays that you can't do with nested arrays, or infer confidently the reasons for their separate existence.
Perhaps, a multidimensional array is always regular and has an associated type constraint (and can therefore have storage layouts and access patterns optimised for that regularity), whereas a nested array can be jagged, and perhaps the inner levels of a nested array can be missing altogether.
But is the need for the distinct concept of a multidimensional array, caused solely by these concerns - namely, that nested arrays suffer from limitations in the type system that don't allow constraints on their shape be expressed (and consequently, an inability to optimise performance for certain regular shapes)?
Or is there something more fundamental about the difference? Something you can do conveniently with multidimensional arrays, which you can't do (or wouldn't do without more difficulty) with nested arrays?
There is nothing that you can do with multidimensional arrays that you couldnt do with nested arrays. The proof: many popular programming languages (C, C++, Java, Swift, ) offer only nested arrays and syntactic sugar to use them for multidimensional purpose. To be fully accurate, some of these languages also provide for multidimensional arrays but with very restrictive constraints (e.g C and C++).
True multidimensional arrays are a convenience offered natively by only some languages (e.g. Fortan, Ada, Julia), when dealing with arrays of a fixed number of dimensions of known size, often for the purpose of offering multidimensional matrixes.
The difference is just in the implementation and libraries bridge the gap:
But this dichotomic view of the array world is very simplified; many more concerns and implementation exist:
So ultimately, what matters is the properties of the multimensional array you need, as well as the envisaged usage patterns.
External links referenced by this document: