The blog starts out with mentioning other reduce operations in Python: 'prod from the math module; min; max; any; all; and "".join'. In APL those are:
×/ product reduce
⌊/ min reduce
⌈/ max reduce
∨/ logical OR reduce (any bool set)
∧/ logical AND reduce (all bools set)
,/ catenate reduce (join without spaces)
These all show a pattern of connection clearly where the Python names don't, that they are related operations; that suggests that you could put any function on the left or any kind of array on the right and see what happens. And they work over multidimensional arrays - and you can swap / for ⌿ to reduce down columns instead of accross the rows.
Your rewritten Python and JS, by showing the operation as length instead of sum, and making a shorter filtered list, hide the connection even further instead of helping to reveal and clarify it.
> "which I feel is more readable (but less efficient) than the APL inspired approach"
I know how to read it, but just look at:
age age ages age
len age for age in ages if age
what's readable about so much repetition, what's readable bout having to spot the single character plural change in the middle of 8 short words?
([>])
that's more symbols than the APL one has, the language people reject because of the heavy use of symbols(!). Why does the [] indicate loopy-listy code but so does 'for'? In PowerShell arrays have a property .Count to use instead of Length - what's readable about
counting the number of ages by indirectly looking at the
length of something? Is this "it's readable because I'm familiar with it" rather than "because it's objectively readable"?