Re:Array Languages: R vs. APL
by dan-robertson on Thursday March 21, 2024 @07:38PM
(#39785760)
Can’t the second argmax example be written with a right tack? Is it nicer then?
(⊢⍳⌈/)+/x
Re:Array Languages: R vs. APL
by jonocarroll on Thursday March 21, 2024 @08:15PM
(#39786023)
Yep, that makes for a nicer tacit solution
maxrow←(⊢⍳⌈/)+/
but I find ⊃(⍒+/)
to be an even cleaner tacit solution.
Re:Array Languages: R vs. APL
by AndyKluger on Saturday March 23, 2024 @06:22PM
(#39803463)
It's not glyph-ish those APL style languages you like, but have you given Factor a good go?
Re:Array Languages: R vs. APL
by jonocarroll on Saturday March 23, 2024 @10:11PM
(#39804596)
I have not. I've done at least one problem (some many more) in each of 32 languages on Exercism so far, though. Looking at your example, there's some familiar features from the lisp and ML families.
The many recommendations for J here are a great nudge for me to give it a proper go. I've taken quite a liking to the traditional APL glyphs ( see a photo of the stickers on my laptop keys in this post https://jcarroll.com.au/2023/12/10/advent-of-array-elegance/ ) so I'm not looking for a way to avoid them.
Another detraction I've seen around is about the ambivalence of APL glyphs (taking either 1 or 2 arguments and doing something different in each case). I don't particularly mind it because I think it becomes more natural to "understand" how a function is being used the more familiar you become with it, but without the limitation on the number of glyphs, I can see the benefit of separating those.