Difficulty with RFC 439 and multidimensional arrays

I should clarify that I do want to define multidimensional arrays that are competitive for numerical operations with built-ins for other languages (e.g. Fortran 2008). That was most of why I brought this up in the first place.

However, I think that in order to get to that goal, this really cannot be done properly without knowing at compile time the order of the array (the number of index dimensions). And that in turn requires either a lot of macros to generate type and function definitions (up to some arbitrary order, say 32), or integer-dependent types (note the thread here).

I’m working on the “lots of macros” strategy, but ultimately I think that we won’t be able to do nearly as well as we could from a usability/ergonomics perspective until some post-1.0 improvements to the type system arrive. The combination of the way indexing works and the lack of dependent types make a lot of things much less elegant.

On the plus side, Rust might be able to provide some guarantees that are potentially very useful for optimization, which numerical libraries in C++ cannot provide (without compiler extensions). E.g. we know that two &mut references do not alias the same array (or overlapping views into an array) in safe code.