3 ms·
Can someone explain how this compares to numpy which also can broadcast. Broadcasting over user defined functions seems to not be possible in numpy. Plus the sy
by npalli 3y ago
Can someone explain how this compares to numpy which also can broadcast. Broadcasting over user defined functions seems to not be possible in numpy. Plus the syntax is clunky (in numpy)
- adgjlsfhk1 3y agoThe two major differences are that broadcasting in julia is 1. caller based. As a user, I can ask for a broadcasted version of any function (not only specific functions which implement broadcasting) 2. composable. The expression `sqrt.(exp.(x).+1)` in julia will generate a single loop over `x` compared to the numpy version which will make 3 passes over the memory.
- npalli 3y agoThanks, seem very much in line with broadcasting being first class in the language unlike Python where the whole scientific ecosystem is grafted on.