The Wikipedia page on order of operations explicitly calls out this exact example:
There are differing conventions concerning the unary operator −
(usually read “minus”). In written or printed mathematics, the expression −3^2
is interpreted to mean 0 − (3^2) = − 9
.
So what we’re doing here is not exactly controversial.
Basically, there are two possible reasonable interpretations of 3^2
:

^
applied to the 3
and 2
, or


applied to ^
applied to 3
and 2
.
Julia chooses the interpretation that matches standard mathematical convention. Moreover, if we used the first (nonstandard) interpretation, then 3^2
would produce a different result than x = 3; x^2
since x
is not a literal so only the second interpretation is possible. The two expressions would parse differently and the former would produce 9
while the latter would produce 9
, which certainly seems like a bad situation.