4 ms·
> { ⊃ ⍵ ⊇⍨ ↑⍒≢¨ ⍵ /⍨ 2≥ (⊂"aeiou") (+/∊⍨)¨ ⍵ } io:read "dict.txt" > At this point, comments suggesting the code is “unreadable” are bound to be thrown around
by amluto 3y ago
> { ⊃ ⍵ ⊇⍨ ↑⍒≢¨ ⍵ /⍨ 2≥ (⊂"aeiou") (+/∊⍨)¨ ⍵ } io:read "dict.txt"
> At this point, comments suggesting the code is “unreadable” are bound to be thrown around
I was actually thinking it was unpronounceable, un-searchable, and almost impossible to type.
I would love to see more work on array languages that map onto human languages, larynxes, and keyboards better.
(Obviously most programming languages are rather English-centric. But they also use a character set that is, for better or for worse, accessible to most of the world. More objectively, it’s also a small character set as such things go, and it’s a simple script in the sense that the characters look the same regardless of context, especially in the fonts used for programming. [0] Character sets like CJK are simple but not small. Arabic and Hebrew are small but not simple (Arabic more so than Hebrew). Even French is mildly complex.
I admit that “{ ⊃ ⍵ ⊇⍨ ↑⍒≢¨ ⍵ /⍨ 2≥ (⊂"aeiou") (+/∊⍨)¨ ⍵ }” is at least approximately equally foreign to everyone. But it’s hard for me to ask a coworker “hey, remind me what ⍒ does again?”
[0] I have never seen anyone suggest programming in English cursive. And ligatures for programming are exotic and rarely affect anyone who doesn’t opt in to them.
- deleted 3y ago[deleted]
- MathMonkeyMan 3y agoI guess we need terse, distinct pronunciations for each of the symbols. I heard a Physics youtuber say "nabla" the other day -- I didn't know that symbol had a name. On the other hand, conventions for reading formulae out loud are difficult and prone to ambiguity. One more idea. Even in ASCII, there are programming language notations that are hard to say. What is Go's "<-" symbol called? "Arrow"? "Send or receive"? What about C++'s "::"? "Colon colon"? It is a neat linguistic puzzle to assign sounds to “{ ⊃ ⍵ ⊇⍨ ↑⍒≢¨ ⍵ /⍨ 2≥ (⊂"aeiou") (+/∊⍨)¨ ⍵ }”.
- ihumanable 3y agoPHP provided an answer to the "::" https://stackoverflow.com/questions/592322/php-expects-t-paamayim-nekudotayim https://stackoverflow.com/questions/592322/php-expects-t-paa... T_PAAMAYIM_NEKUDOTAYIM which of course is Hebrew for "Double Colon"
- amluto 3y agoThat’s worse, IMO. At least in Physics you can say “the gradient of f,” and I’ve rarely heard people say “nabla” when talking about physics. And you can look up “gradient” just fine. We don’t need more jargon just for jargon’s sake.
- deleted 3y ago[deleted]
- shrubble 3y agoThat symbol is easy to remember, it is Grade Up and when pointing the other way it is Grade Down -and yes I did remember that from sight and did not have to look it up. See https://aplwiki.com/wiki/Grade-Up https://aplwiki.com/wiki/Grade-Up
- amluto 3y agoNow I know what that particular symbol means! Except that it looks kind of like a down arrow, and that link suggests it’s Grade Down. Would writing argsort(name_of_array, reverse=True) really be so much worse? Or argsort[reverse] (made up syntax) if you want a point-free function form?
- shrubble 3y agoYou are correct, it is "Grade Down". Some people prefer terseness, think of this as "advanced next-level Perl one-liners" if that helps ...
- lokedhs 3y agoIt's not sort. In Kap, sort down is ∨. The grade functions returns a sorted index. Basically ⍒ 3 1 2 1 1 returns 0 2 1 3 4. So yes, it performs a sort, but it returns an index that can be used to later look up the respective elements. You can read more about it here if you're interested: https://www.aplwiki.com/wiki/Grade https://www.aplwiki.com/wiki/Grade And here's a silly example where a random array is created, then an array lookup is performed on the sorted indexes: https://kapdemo.dhsdevelopments.com/clientweb2/#a%20%E2%86%90%20%3F20%E2%8D%B4100%20%20%20%20%20%20%20%E2%8D%9D%20Create%20a%20random%20array%20of%2020%20numbers%20between%200%20and%2099%0Ab%20%E2%86%90%20a%5B%E2%8D%8Ba%5D%20%20%20%20%20%20%20%20%20%E2%8D%9D%20Look%20up%20values%20in%20a%20based%20on%20the%20graded%20index%0An%20%E2%86%90%20(%3Ca)%20%E2%8D%AA%20b%20%20%20%20%20%20%E2%8D%9D%20Increase%20the%20rank%20of%20a%20(turning%20it%20into%20a%202-dimensional%20array)%20and%20attach%20b%20below%20it%2C%20creating%20a%202-by-20%20array%0Achart%3Abar%20n%20%20%20%20%20%20%20%E2%8D%9D%20Display%20the%20result%20in%20a%20bar%20chart%0An%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%E2%8D%9D%20Return%20n%20so%20it's%20printed%20after%20the%20chart https://kapdemo.dhsdevelopments.com/clientweb2/#a%20%E2%86%9...