To be honest, the big issue with x
is that it is a valid identifier. It also suffers a bit from NIH syndrome (we have another mainstream language similar to Swift, Rust, which has an established and familiar syntax [5; Int]
, why not just adopt it?), but except these two issues it is fine. It looks like \times
symbol in TeX and reads the same. [5 x Int]
means "5 times Int" which is pretty clear description of an inline array. So from readability point of view, it is not worse than of
or by
, and not worse than the whitespace syntax [5 Int]
that many people loved, and actually better if you are willing to accept that x
reads as "times". It has other advantage over by
and of
by being shorter and by resembling established mathematical notation. (Since +
means concatenation, *
or \times
(aka x
) is a commonly used notation to describe repeated concatenation. Maybe calling x
operator \times
and have autocomplete automatically convert it to the proper ×
symbol would make some sense, but x
requires less typing and looks the almost the same.
It also has the advantage of being easily extended to define multidimensional arrays (when they are treated differently from nested arrays). Other proposed syntax forms (including ;
) don't have this advantage, unless we adopt tuples as valid generic arguments.