I agree that this is very clear. I think the main downside is that it’s a major departure from e.g. C and current Stan. All in all, I’d be happy with it.
Edit, to give some context for this design space:
Fundamentally “array
” is like a function that takes a size N and a type T and returns a new type. That’s called array
’s kind signature, analogous to a function’s type signature. We’re talking about syntax for type application, which is analogous to function application.
So in array[2] matrix[2,2]
you can say that array[2]
is a partially applied type which is then applied to matrix[2, 2]
, and the syntax for type application is juxtaposition with a space. That’s analogous to writing function application f(x)
as f x
(which some languages do).
One thing to consider is that using ’ ’ for type application doesn’t let you explicitly specify associativity or precedence, which we’ll run into if we add more parametric types in the future. But that’s a crossable bridge if we get to it.