News for hackers. Stuff that matters.

jonocarroll

Re:Array Languages: R vs. APL on Sunday March 24, 2024 @09:05PM (#39812000)
In Dyalog APL you can set the index origin with ⎕IO←0 (or 1) and there are many ways in which this can bite you. In Lua, and I think Fortran, you can specify the range of array indices manually.
Re:Array Languages: R vs. APL 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.
Re:Array Languages: R vs. APL 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 on Thursday March 21, 2024 @06:05PM (#39784987)
I've seen the connection made here https://dev.to/bakerjd99/numpy-another-iverson-ghost-9mc though the link to the source quote is broken. In all fairness, Matlab is itself inspired by APL.
Re:Array Languages: R vs. APL on Thursday March 21, 2024 @05:35PM (#39784688)
(author here, still getting over the first time I've seen one of my own posts on this site)

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.

Re:Array Languages: R vs. APL on Thursday March 21, 2024 @05:29PM (#39784629)
What's interesting there is that numpy is inspired (more than a little) by APL and aims to bring that 'array' thinking to python. I agree that thinking in this 'array' way helps to better construct a solution in any language, so I'm leaning towards 'designing' with APL glyphs, even if that's not the language I'm implementing the thing in.