https://www.arraycast.com/episodes/episode111-ideal-array-la...
It can be faster than Fortran based library that is still being used by Matlab, Rust and Julia [1].
It will be interesting to compare Mojo moblas BLAS library with GLAS library performance in D.
[1] Numeric age for D: Mir GLAS is faster than OpenBLAS and Eigen (2016):
http://blog.mir.dlang.io/glas/benchmark/openblas/2016/09/23/...
Taking examples I am familiar w/, it is key that you can add a scalar 1 to a rank 2 array in numpy/matllab without having to explicitly create a rank 2 array of 1s, and numpy somehow generalizes that (broadcasting). I understand other array programming languages have more advanced/generic versions of broadcasting, but I am not super familiar w/ them
⊢×0≠∧˝˘∧⌜∧˝ # Marshall & Dzaima (tacit!)
(≠⥊∧´)˘{×(⌾⍉∧)0≠} # Dzaima & Rampoina
{×(∧˝˘∧≢⥊∧˝)0≠} # Dzaima
Call me old fashioned and stuck in C style syntax but I can't imagine anyone describing this as beautiful art.And a comfortable APL is clearly an oxymoron.
The double-struck characters have disappeared from the second and third lines creating a fun puzzle. Original post https://www.ashermancinelli.com/csblog/2022-5-2-BQN-reflecti... has the answers.
Think about using matrix to describe geometric transformations instead of using standard functions.
So "rank polymorphism" means being able to write expressions that work correctly regardless of how many dims the arrays involved have.
For example, in numpy you can write a function that handles both lists and matrices automatically, by taking advantage of broadcasting. (The J language takes this idea a lot further -- numpy is a fairly minimal implementation of the idea.)
abcd_f•4h ago
> IMO this is what makes something an array language.
Great to hear. So what is it?
preommr•3h ago
djoldman•2h ago
Example 1: A function that can take as input a 4x2x8 matrix or a 3x7 matrix.
Example 2: A function that can take as input a 4x2x8 matrix and a 3x7 matrix and output a third matrix.
almostgotcaught•1h ago
which shows that this feature request is complete jibberish
tomsmeding•4m ago
If rank polymorphism results in accepting both 4x2x8 and 3x7, then that means the function was a function on elements to begin with. Which is possible, but not the most interesting application of rank polymorphism.
CapsAdmin•2h ago
There are other cases like adding vectors to matrices and so on, but in the end this logic is defined in some custom add operator overload on a class or object in the language.
(I had no idea what it meant either until i searched for examples..)