Hacker News new | ask | show | jobs
by beagle3 1487 days ago
APL, K or J ; I've learned APL, and was able to use it effectively - but things only really "clicked" when I learned K; And despite several attempts, J never did click for me -- not sure why, probably the associations I have for the ascii characters are too strong to break.

But yes, highly recommend learning members of this family. It will help your C for sure as well, though possibly not in ways you'd expect.

After using APL and K for a while, I realized 95% of "abstraction" features in C++ / C# and friends are useless; I now avoid C++; My C code became way shorter, way more efficient, way simpler -- but also much less orthodox.

1 comments

What do you recommend to learn APL and K?
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/