Sure, I’ve also heard that about modern Fortran, but I’m not really familiar with it.
But, doesn’t it? I believe even parts of Julia Base are implemented in a functional style, using reduce
, map
etc.
I thought, though, that this thread was more about ‘Matlab style’ Implicitly vectorized code. In which case Julia still does well, but it is the core business of Matlab (and I guess numpy), implemented and optimized at considerable effort in a static language.
Still, Julia can reliably fuse broadcasting, and do it in-place, which is an advantage.
I just thought that referred to the use of unicode symbols😄
That’s not really fair. Vectorizing code is often a very demanding effort, it’s not just about simple surface-level syntax. You need to make sure every level of your code handles array data, make design decisions concerning preferred vector orientation (Nx1 vs 1xN), you have to slice, reshape, gather, calculate intricate index sequences, etc.etc. It can be a huge job, I’ve spent literally weeks vectorizing single algorithms in Matlab, after which they look unrecognizable, and highly complex. It’s an effort not to be undertaken lightly, and is very much a non-trivial optimization.
Reframing Matlab ot Python code to vectorized style very often involves contortionate transformations, when the original algorithm is ‘naturally’ scalar/serial. I’ve spent a large portion of my Matlab career converting simple scalar code into ugly, incomprehensible vectorized code. In Julia, on the other hand, you can vectorize scalar code by just slapping some dots on your top-level code.