3 ms·
APL (and especially J and K) are about a lot more than array based programming, and NumPy didn't try to encompass those, which is part of the reason it is easie
by beagle3 6y ago
APL (and especially J and K) are about a lot more than array based programming, and NumPy didn't try to encompass those, which is part of the reason it is easier to learn.
K below:
,//
|/0(0|+)\
The first expression is usually called "flatten" (take a nested list and produce the list of all items in a single-level, in order). The second expression is a solution to the maximum-subarray-sum problem. Both of them leverage a hell of a lot more than "array" programming; in each case, every single character brings its own semantics, and the combination yields the semantic of the entire expression.
Not disagreeing that NumPy is more popular. Am disagreeing that they are "extremely similar".