APL versus A versus J versus K?

To add some more information...

There is an open source version of K called Kona https://github.com/kevinlawler/kona

For q/kdb+, there is a trial version. http://kx.com/download/

The main limitations are 2 hour timeout, 32 bit memory, 3 month license expiration, and the license itself. These shouldn't be too bothersome if you just want to play around and learn something.

Personally, I found q to be the most user friendly since KX translated the monadic (single argument) verbs from K into English words and there is a good amount of documentation @ http://code.kx.com. In addition, the database system is extremely well thought out and flexible.


Something to consider is the vocabulary of operators (higher-order functions).

Original APL only has last and first axis reduction (fold) (f/, f⌿), last and first axis cumulative reduction (f\, f⍀), plus inner and outer product (f.g, ∘.g).

Most extended APLs (e.g. GNU APL, APLX, APL+Win, APL2) only add the each-loop (), and axis bracket specification (f[...]).

J, added a plethora (called adverbs and conjunctions), but removed brackets (both axis and indexing), the each operator (in favor of the more general rank operator), and last-axis (cumulative) reduction.

The now defunct Sharp APL (and later SAX) retained both the traditional last-axis operators and bracket indexing, while adding many of J's new operators.

Dyalog APL is gradually approaching the vocabulary of Sharp APL, but has also incorporated J-exclusive operators that never made it into Sharp APL.

The below table compares J, Sharp APL, and Dyalog APL composition vocabularies. The entries with faded text require two symbols to effect. The entries with grayed background are under proposal. J, Sharp APL, and Dyalog APL compositions


The differences among these languages are relatively subtle. APL "proper" has the advantages, and disadvantages, of the original symbolic notation. (There are minor changes that have been made to the symbol set over the years, but they're all true enough to the original vision.)

The A+ language is available open source. It departs significantly from the "classic" APLs, but is like them in keeping most of the core character set. My sense is that it has not been kept up to date with technology changes. It was a precursor to K.

Languages in the array-language family that have departed from the distinctive APL character set include J, K, and Nial. Nial uses English words instead of symbols, and has an open source interpreter called Q'Nial. K and J rely mainly on symbols, but these are drawn from the ASCII character set. Words may be used in place of symbols in these languages, however, simply by assigning definitions.

The APL family of programming languages have been primarily proprietary since the initial appearance of APL as an IBM product in 1964. Proprietary array languages seem to have more support and faster evolution of new capabilities than open source alternatives at this time. I'm not sure how all the competitors stack up against one another, but Dyalog APL has certainly been working actively to promote their implementation of the language as current technology. APL2000 offers products for Unix, Linux, and Windows, including VisualAPL for .Net (retired). MicroAPL Ltd offers APLX (retired).

K is a specialized language that is no longer being marketed on its own. Kx Systems is instead marketing the Kdb+ database and its Q (query) language, both of which are written in K. It's a powerful specialized tool, designed for high-speed processing of streaming data. It departs significantly from the original APL approach. Kx Systems products are expensive and their users mostly work in finance.

APL was envisioned and mainly designed by Ken Iverson. After a full career of applying and refining APL in commercial applications he turned to the task of making a "rationalized" revision, one that corrected the aspects of the language he'd found himself dissatisfied with over the years. This fresh take on the theme is called J. The differences between J and APL are sketched in a paper on the J Software wiki. One noticeable change is the elimination of array indexing syntax. The biggest feature, though, is tacit form, in which programs are written by composing functions without reference to their arguments. Tacit J is closely related to "point-free" style found in functional programming languages, but differs in that this form is fundamental to the J language. The ASCII-based symbols used in J may be harder to read than the more distinctive APL characters.

For an individual wanting to learn an array language, my advice is to select among Dyalog APL, APLX, J, and Q'Nial. Dyalog APL (esp. for Windows) or APLX (esp. for Linux) are likely best for someone who wants to use the core symbolism that is so distinctive to APL, and who wants strong connection with the APL community as a whole. J may be best for those who want to build web applications, or focus on math (like Project Euler,) and especially those who are fascinated by the tacit style it emphasizes. Q'Nial is what I'd pick if my priority was on open source, but only if that priority did not also mean expecting the support of an active OS community.


UPDATE: J 7.01 has been released with open source code under GPL 3. In addition there is Kona, a variant on K. These increase the options for open-source array languages.

UPDATE by Tobia: GNU APL is available under the GPL. It follows closely the latest published ISO standard on the Extended APL language. It is a great open source APL implementation and is being actively developed and maintained. There are other interesting implementations too, for example ngn/APL, a surprisingly well-featured and modern implementation of APL written in CoffeeScript (which compiles to JavaScript.) Array languages are alive and well in 2015.

UPDATE by Adám: Roger Hui, one of chief implementers and designers of J, has since joined Dyalog, and under his guidance, Dyalog APL has added many J-inspired features. This includes a tacit functional programming style and several operators and functions, many of which have been improved in the prcess. Dyalog APL is now free for non-commercial usage. In addition, several new APL implementations have appeared; see aplwiki.com. Array languages are alive and well in 2020.

Tags:

J

Apl

K