4 ms·
Array languages are such a mind twist and so fun. I dabbled in J at one point, and I love explaining +/%# to people. But the real expressive power comes when
by gcanyon 1y ago
Array languages are such a mind twist and so fun. I dabbled in J at one point, and I love explaining
+/%#
to people. But the real expressive power comes when you start to get into tacit expressions yourself, understand function exponents, and "get" under.
Hmmm... maybe I need a refresher...
- cess11 1y agoThere's an APK, for dabbling on the phone at times when there's no larger computer available but still time to spend. https://code.jsoftware.com/wiki/Guides/JAndroid https://code.jsoftware.com/wiki/Guides/JAndroid
- liveranga 1y agoHaving J on the phone in your pocket is great. And lots of the "labs" (interactive tutorials) are built in too: 3 dots -> Help -> Labs.. Edit: I should also have mentioned that Termux on android can build ngn-k, goal and a bunch of other open source array languages too. There's also Rob Pike's Ivy language for Android too.
- ofalkaed 1y agoFor android and apl we also have dzaima's AndroidIDE which is the best android array implementation that I have found. https://github.com/dzaima/APL/tree/master/AndroidIDE https://github.com/dzaima/APL/tree/master/AndroidIDE
- 1-more 1y ago> I love explaining +/%# Based on the one thing I remember in APL I'm guessing the first two characters are "sum over some data structure" and the data structure is what the next two mean. What does it mean entirely?
- Romario77 1y agoavg=: +/ % # +/ sums the items of the array. # counts the number of items in the array. % divides the sum by the number of items.
- 1-more 1y agodelightful, ty. How does it handle empty arrays? Throw? Average is zero? Average is infinity?
- deepsun 1y agoI'd call that code obfuscation. a.sum() / a.count() you would not need an explanation.
- hatefulmoron 1y agoK et al. can look like that, but this example doesn't require any explanation to someone who has any familiarity.
- pasquinelli 1y agothe thing about tacit programming is that it wouldn't use 'a' in the above. if you wrote average in j without it being tacit, it would probably be more readable to you. the question of how to thread data around without naming it is an interesting one to me.
- 1y ago