APL versus A versus J versus K?

j apl k
fogus picture fogus · Oct 8, 2010 · Viewed 14.7k times · Source

The array-language landscape, while fascinating, is confusing to no end. Is there a reason to pick one of J or K or APL or A? None of these options seem to be open-sourced -- are there open sourced versions? I would love the expand my mind, but I remain befuddled.

Answer

kaleidic picture kaleidic · Oct 13, 2010

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.