Hacker News new | ask | show | jobs
by yakubin 1487 days ago
What do you recommend to learn APL and K?
3 comments

Try “Learning APL” —- https://xpqz.github.io/learnapl

Disclaimer: I’m the author

Thanks. Will check it out.
From https://en.wikipedia.org/wiki/K_%28programming_language%29

Here's their example:

The following expression sorts a list of strings by their lengths:

x@>#:'x

Ooooooookay. Personally, I recommend a lot of alcohol. This will be a very wild and geeky ride. Bring extra pizza.

Personally, I recommend less alcohol.

Pronounced, this would be "x at grade-down of count of each x" - and indeed, in "q" (a syntactic sugar for K that uses words instead of symbols), this is almost how you would write it (rather: "x at downgrade count each x". It's basically algorithmic math notation: In math you say "b^2-4ac" rather than "b squared minus 4 times a times c". In K you say "x@>#:'x".

It's not just a matter of symbol/syntax familiarity - there's also idioms, etc. But the "scariness" is similar to the "scariness" of a language like Japanese or Arabic, which uses different graphic elements, syntax, vocabulary, and idioms. You might not like it, but it's not because there's something weird or wrong about it -- it's just foreign.

Sounds like a recipe for alcohol addiction and obesity. Otherwise maybe I'd try that. ;)
I learned APL on a mainframe over 30 years ago, which is not something I'd recommend (also, you're unlikely to have access to one), but rumor says Dyalog has good tutorials, such as "Mastering Dyalog APL", see links here https://www.dyalog.com/getting-started.htm

As for K, Stefan Kruger's text seems like a good introduction https://xpqz.github.io/kbook/Introduction.html

Thanks. Will check these out.
I’ve written a few things on APL and K for the learner. Links here:

https://xpqz.github.io/about/