|
|
|
|
|
by StreamBright
2499 days ago
|
|
I think we have to separate two things here. a, array programming concepts b, apl like syntax I think the combination of these two makes J and co interesting. I am just not sure if the second is required. Not sure how much is lost if we use the following: kmc =: right (step power infinity) initialise
initialise =: (left deal tally at right) from right
step =: (left groupby allocate rank 1 2) then (mean every)
allocate =: euclidean then (equal minimum) then indices then head
euclidean =: (minus then square then sum) vectors
I totally agree with you that nested loops should not be the way to express mathematical computation over matrixes. I was just curious that we need the (for me) obfuscated syntax or we can use more of the plain English version without performance differences. After reading about J more the biggest difference between J and APL is that J is restricted to ASCII characters. |
|
We lose manipulability.
I can perfectly read an expression like this:
Even I can easily rewrite (with just a few keystrokes, if I have the right editor), into this equivalent expression: But, when I make the conversion in my head, I see the mathematical formula. I can easily parse the English version and I can easily write it, but in my head I work with the formula, not with the words.APL languages have a considerable number of symbols to memorize (with the exception of k, which has very few primitives, J in particular has many of them), but the core is always the same and relatively small (see the APL Dictionary, by Iverson), and many symbols are related so they are easy to remember. Nevertheless, it takes a while. Once you learn the symbols, you need to learn common idioms and constructions, which takes even more (J, with a prevalent tacit style, makes this quite difficult) but once you start getting it and can manipulate the symbolic expressions in your head, the English version does not matter any more.
There are other reasons, like keeping a large amount of the program on screen (see the videos of arcfide), but mental expression manipulation is what convinced me.