The biggest problem with C's pointer syntax is that it's prefix to the value.
int p*
is just as horrible as int *p
because in both cases, it obscures that the type of p is "pointer to integer".C's array and function syntax have exactly the same issue, the entire thing is back-asswards.
Let me demonstrate by converting your examples to a more regular (and logical) language[0]:
let i: i32 // integer
let i: Box<i32> // pointer to integer
let i: fn() -> i32 // function returning an integer
let i: Box<fn() -> i32> // pointer to a function returning an integer
let i: fn() -> Box<i32> // function which returns a pointer to an
let a: [i32;10] // array of 10 integers
let a: [Box<i32>;10] // array of ten pointers
let a: Box<[i32;10]> // pointer to an array
let a: [fn() -> Box<i32>;10] // array of ten functions that return a pointer
Even if you want to shorthand pointers (because you have only one and want it to be built-in), it remains significantly more readable than both C actual and your version.[0] which doesn't mean perfect e.g. one could argue against the special syntax for arrays