Understand vectorized dot operators

I wouldn’t phrase it this way. Julia’s vector .+ scalar is perfectly well defined and meaningful mathematically, and symbols can mean whatever we want them to mean. It’s just not an operation of linear algebra, and Julia reserves + for the ordinary algebraic meaning.

Julia used to be more Matlab-like and supported implicit vectorization/broadcasting of many functions (e.g. vector + scalar, sqrt(vector), and so forth). However, this was changed when we got the f.(x) “dot syntax” to broadcast any function, since it turns out that this gave us big advantages by being syntactically explicit, as explained in this blog post.

Interestingly, Julia originally had vector + scalar, then it was removed (julia#5810), then it was added back (julia#7226), and then finally it was removed again (julia#22932) once we had fusing f.(x) syntax for all functions. See the linked issues for long discussions of the pros/cons — this is not something we decided on a whim, but after extensive debate and trial-and-error.

See also Idea Julia Lite or 'Juliette'? - #55 by stevengj

4 Likes