4 ms·
APLcart – Find your way in APL
- skruger 4y agoAPLcart is a searchable idiom collection database — snippets of code that you can search for with a “how do I achieve X” type question. I’ve not seen this for languages outside the Iverson family, but it could be equally useful for other languages, too. Note that it’s accessible from within Dyalog apl as a user command: ]aplcart
- t-3 4y ago> I’ve not seen this for languages outside the Iverson family, but it could be equally useful for other languages, too. The closest thing would probably be Rosetta Code. Iversonian languages seem to be relatively unique in their rejection of defined functions in favor of composition of language primitives, so it seems that libraries are reached for before idiomatic expressions in other langs. It seems like an algorithm dictionary in plaintext or pseudocode would be a great boon for all.
- moonchild 4y agoThat's what knuth is, isn't it?
- rockzom 4y agoAnybody tried using APL to maximize token context in ChatGPT?
- rgbrgb 4y agoI had this same thought. The downside would probably be that you have a much much smaller set of open codebases to crib from and (for me) inevitable bugs will be way harder to spot.
- dintech 4y agoNice! I’d love to see this for K also.
- chrispsn 4y agohttps://secwang.github.io/ngnkcart/ https://secwang.github.io/ngnkcart/
- wslh 4y agoWhat is the K homepage and source code repository? When I hear for K on Internet I read this [1] but confused if it is the same of this [2]. https://shakti.com/ https://shakti.com/ [1] https://en.wikipedia.org/wiki/K_(programming_language)?wprov=sfti1 https://en.wikipedia.org/wiki/K_(programming_language)?wprov... [2] https://shakti.com/ https://shakti.com/
- Voklen 4y agoI've also heard it has a really interesting system for creating UIs but cannot find anything about it
- t-3 4y agoAs best I can understand, K is proprietary and you need to have a business relationship with Arthur Whitney to get access to the latest. You can get a free trial for personal use here: https://kx.com/download-kdb/ https://kx.com/download-kdb/. There are some open source clones like: https://codeberg.org/ngn/k https://codeberg.org/ngn/k https://github.com/kevinlawler/kona https://github.com/kevinlawler/kona https://github.com/JohnEarnest/ok https://github.com/JohnEarnest/ok , and inspired languages: http://t3x.org/klong/ http://t3x.org/klong/
- maximus-decimus 4y agoHere's the ngn/k opensource implementation I used for AOC last year https://codeberg.org/ngn/k https://codeberg.org/ngn/k
- surprisetalk 4y agoWow, this is exactly the resource I've been looking for to learn APL! I took one of the idioms and posted it into ChatGPT: Can you explain this APL program to me? (1=≢∘∪)Y It gave me an extremely helpful breakdown, and its analysis matched the description on APLcart.
- JoeAltmaier 4y agoBecause it was cribbed from there. If you know an authoritative source of information on a subject, for God's sake don't ask ChatGPT on the hope it will find it too, parrot it back, because it has a high probability of putting unrelated but plausible-sounding shit in there. Leaving you to sort out what's real and what's statistically-related nonsense.
- _a_a_a_ 4y agoOnly one data point but I asked a question to my boss and he sent me a GPT reply (which he's starting to do rather too much these days) which was very incomplete at best, possibly outright wrong but also very misleading even if it was right. It certainly read authoritatively, caveat emptor.
- jodrellblank 4y agoWhat makes you say it was cribbed from there? The APLCart explanation is "Are all major cells of Y identical?" and the ChatGPT explanation I got from the prompt "can you explain this APL program to me" is: ---- ---- Certainly! Let's break down the APL program (1=≢∘∪)Y step by step. First, let's focus on the function ≢∘∪. The symbol ∘ is called the "composition" operator, which means it takes two functions and returns a new function that applies the second function to the result of the first function. In this case, ≢ and ∪ are the two functions being composed. ≢ is the "tally" or "count" function, which returns the number of items in an array. For example, ≢ 'Hello' would return 5. ∪ is the "unique" function, which removes duplicates from an array. For example, ∪ 1 2 3 3 4 would return 1 2 3 4. So, ≢∘∪ means "count the number of unique items in the array". For example, if Y is 1 2 3 3 4, then ≢∘∪ Y would return 4, because there are 4 unique items in the array. Now, let's look at the entire program: (1=≢∘∪)Y The parentheses are used to group the functions together, so that they are treated as a single function. 1= compares the result of ≢∘∪ Y to 1. If the result is equal to 1, then 1= returns 1 (true). Otherwise, it returns 0 (false). So the entire program (1=≢∘∪)Y means "return true if there is only one unique item in the array Y, and false otherwise". ---- ---- That doesn't seem like a crib from the APLCart sentence at all. And this explanation is correct as far as it goes - it just doesn't go far enough to mention "major cells" (i.e. it would deduplicate the rows of a 2D matrix, not the individual elements). And it doesn't mention parentheses around the pattern (constant function function) is significant and makes a 'train' but then neither does the APLCart one.
- otabdeveloper4 4y agoBest April Fools joke ever.