Unlike other languages like Scala, R and Haskell, for Rust it was decided not to go with arbitrary operator definitions, but instead syntax sugar for certain trait methods (also like Scala).
This accepted Python EP will be implemented in Python 3.5. The reasons mentioned there are relatively language-agnostic. Please go there to read them all, but the gist is:
- Many number crunching applications (i.e. pretty much most algorithms in existence) profit from matrix and n-dimensional array operations
- A basic one is, besides elementwise multiplication, the matrix multiplication
- Alternatives have to rely on converting matrices to specific types that interpret * as matrix multiplication (e.g.
e(m(mat1) * mat2) * mat3for the formula (mat1 × mat2) · mat3), or method calls (
mat1 * mat2).dot(mat3)doesn’t look bad, but try dotting a few more times…). Both suck and get unwieldy fast for more complex formulas