Thursday 22 April 2004 — This is over 20 years old. Be careful.

For some reason, the topic of APL came up yesterday at the office. APL is one wild-ass idiosyncratic language. It stands for A Programming Language, and was created in 1962 by Ken Iverson. One of its most unusual aspects is that it requires an entirely new character set, including not only Greek letters, but new symbols created by Iverson. To add to the typographic diversity, even more new symbols were created by backspacing and overstriking two symbols together!

Here’s an example I scanned from an APL book:

The lamp character introducing the comments is formed by overstriking a small circle with a mathematical intersection character. The difficulty of entering this symbol may help explain the typical lack of comments in APL programs!

Procedures are created with numbered lines of statements, and the only structuring mechanism is the goto (the right-pointing arrow):

APL is really a calculator on mega-steroids. Its pervasive matrix operations give the programs their particular flavor. Looping is rare, with data in matrices acted on with single strokes. To use an analogy, where a more typical programming language lets you deal cards one at a time from a deck, with APL you usually figure out how to throw the entire deck into the air so that the cards all land where they should. For example, this hex dump program has no loops or gotos at all.

There are more modern implementations of APL that solve the character set problem. J seems to be just an implementation of APL without the wacky characters, although the home page doesn’t mention APL!

## Comments

Paul R4:58 AM on 23 Apr 2004Adrian Howard6:42 AM on 23 Apr 2004Yeah. I know a couple of statistics fiends who still swear by APL.

Perl 6 is following in APLs footsteps by adopting several non-ASCII characters into the core language like « and ».

Carl Tyler12:39 PM on 23 Apr 2004Andy Neilson9:21 AM on 24 Apr 2004One downside is that the extreme conciseness of the language can lead to extremely obscure code. It is possible to write clear code (where conciseness is an asset), but it takes some discipline. I've certainly been guilty of reducing an entire program down to a single impenetrable line of code.

I may be mangling the story, but I think APL started out as a mathematical notation to describe the IBM S/360 architecture. It was only later on that it was turned into an executable language. What a concept: a computer language with a mathematical basis!

APL is still around, and it continues to be used. I've since rewired my brain for other languages.

Randy MacDonald12:17 AM on 13 Sep 2005## Add a comment: