4 ms·
K fits APL functionality into ASCII by selecting a smaller (but empirically, better suited) "base". It's not a transliteration of APL into ASCII. e.g., the fir
by beagle3 13y ago
K fits APL functionality into ASCII by selecting a smaller (but empirically, better suited) "base". It's not a transliteration of APL into ASCII.
e.g., the first element operator is unary asterisk e.g. "x", which is like C's pointer dereference (which gets the first element ..). There is no symbol for "last element" - instead you use "|x" meaning "first of reverse of x". Similarly, there are no compress/expand operators; Instead, there's a "replicate" operator which unifies and simplifies both (and has other uses to boot).
In fact, it looks like Arthur used the number of ascii symbols as a constraint for the number of primitives - which are all single characters. (They can be postfixed with a colon to force monadic comprehension, but that's not part of the operator). As a result, K is as much notation as APL is. The domain is "writing real world programs" instead of "expressing algorithms", and it shows, but it's still notation that -- once acquired -- reads like math or APL.
> One of the reasons I abandoned languages such as APL, Forth and Lisp, languages that I used extensively for many, many years is that they became less and less practical and relevant.
I suspecting it's going to make a come-back. The APL / J / K computation model is much easier to apply to GPUs. But prediction of trends is very hard -- doubly so when it is about the future :)
- robomartin 13y agoA long time ago in a galaxy far, far away I had a project on the table to build a hardware-based APL machine with enhancements and extensions to the language. We looked at it very critically and decided that, while applications might be out there, the cost of sales and educating the potential customers was just too great. Just because you can do something it doesn't mean you should. Today things might be different.