I think it is for the sake of computational sanity. Even the complexity needed to resolve whether >
is an operator or a generic argument list marker has been stated to be unfortunate.
You are correct, but the tokenizer cannot know this without information from much later phases of compilation, and full knowledge of all files in the module and all its dependencies.
The longer the operator stack gets the worse the problem becomes:
let x: Angle = ∡∛−√∑[6, 1, 8, 3]
We humans can all probably all tell what that is supposed to do: sum the array, find its square root, negate it, find its cube root and wrap it into an Angle
type using radians. But if we ignore our understanding of what the symbols mean, there are 16 different ways to parse that into separate operators that the compiler would have to wade through:
let x: Angle = ∡∛−√∑[6, 1, 8, 3] // 5 (Compiler’s current understanding.)
let x: Angle = ∡∛−√(∑[6, 1, 8, 3]) // 4, 1
let x: Angle = ∡(∛−√∑[6, 1, 8, 3]) // 1, 4
let x: Angle = ∡∛−(√∑[6, 1, 8, 3]) // 3, 2
let x: Angle = ∡∛(−√∑[6, 1, 8, 3]) // 2, 3
let x: Angle = ∡∛−(√(∑[6, 1, 8, 3])) // 3, 1, 1
let x: Angle = ∡(∛−√(∑[6, 1, 8, 3])) // 1, 3, 1
let x: Angle = ∡(∛(−√∑[6, 1, 8, 3])) // 1, 1, 3
let x: Angle = ∡∛(−√(∑[6, 1, 8, 3])) // 2, 2, 1
let x: Angle = ∡∛(−(√∑[6, 1, 8, 3])) // 2, 1, 2
let x: Angle = ∡(∛−(√∑[6, 1, 8, 3])) // 1, 2, 2
let x: Angle = ∡∛(−(√(∑[6, 1, 8, 3]))) // 2, 1, 1, 1
let x: Angle = ∡(∛−(√(∑[6, 1, 8, 3]))) // 1, 2, 1, 1
let x: Angle = ∡(∛(−√(∑[6, 1, 8, 3]))) // 1, 1, 2, 1
let x: Angle = ∡(∛(−(√∑[6, 1, 8, 3]))) // 1, 1, 1, 2
let x: Angle = ∡(∛(−(√(∑[6, 1, 8, 3])))) // 1, 1, 1, 1, 1 (What we meant.)
And every one of those combinations must also be run through type inference.
Thus the current rule...
error: Unary operators must not be juxtaposed [...]
...and the compiler’s advice...
[...] parenthesize inner expression
...which allow you to explicitly have used any of the above combinations were it really what you wanted, while keeping everything manageable for the tokenizer.