APLs and Oranges

APL is 40 (or is it 50?) years old. But comparing it to more modern programming is like comparing APLs to oranges.


January 11, 2007
URL:http://www.drdobbs.com/architecture-and-design/apls-and-oranges/196900217

To tell the truth, I don't know the first thing about APL. But as you've probably come to expect, that's never stopped me before. What little I do know about APL is this: APL is short for "Array Programming Language" (or maybe "A Programming Language") and it's been around for 40 (or maybe 50) years. That people are seriously using a programming language like APL after 40 (or 50) years is noteworthy. Will Ruby, for instance, still be around four decades from now, or is the world of software development changing such that it doesn't matter? Or, as with televisions, razors, and broken-down magazine editors, are we moving into an era of disposable programming languages?

In any event, APL apparently started out perhaps 50 years ago when (in 1957) Harvard professor Kenneth Iverson developed a mathematical notation consisting of symbols and syntax to describe the processing of data. Iverson subsequently joined IBM Research, where, in 1964, 1966, or 1967 (depending on who you talk to), he turned it into a full-blown programming language. In between Harvard and IBM, he wrote a book entitled A Programming Language, to which some people attribute the acronym representing the language itself.

APL has been described as one of the most concise, consistent, and powerful programming languages ever devised. It can also be pretty straightforward. For instance, a "Hello World" program is as simple as:

'Hello World'

where any text within quotes outputs to the terminal (variables and/or print statements aren't necessary).

Far more interesting (and a shade more complicated) is Michael Gertelman's "Conway's 'Game of Life'" in one line of APL (catpad.net/michael/apl):

This leads to one of the oft-criticized aspects of APL—its special character set. Granted, the special characters have been incorporated into Unicode, but they must be entered via nonstandard means, such as special keyboards. IBM took a sledgehammer approach to addressing this problem by developing a Selectric typeball (remember those?) for writing linear representations of APL notation. In the 1990s, Iverson opted to address the problem via software by developing an APL derivative language called "J," which uses a standard ASCII font (see www.jsoftware.com).

There are also a couple of other APL derivations—APL2 and APL2 Version2. APL2 is used in commercial data processing, system design and prototyping, and engineering and scientific computation, among other subjects. APL2 Version 2 supports sophisticated array processing, along with graphics, GUI, file access, and network communication tools—and interfaces to other programming languages and database systems. There are both commercially available APL tools, such as MicroAPL's APLX (www.microapl.co.uk/apl) and IBM's Workstation APL2 (www-306.ibm.com/software/awdtools/apl), and freely available ones, such as compilers and interpreters (www.thefreecountry.com/compilers/apl.shtml).

For his pioneering efforts with APL, Iverson received the Turing Award in 1979. Not bad for someone who taught himself calculus while attending a one-room schoolhouse in rural Alberta.

One thing I like about APL is all of the comments and doggerel it's generated over the years. In his classic The Devil's DP Dictionary, Stan Kelly-Bootle says:

There are three things a man must do

Before his life is done;

Write two lines in APL,

And make the buggers run.

Not to be outdone, Edsger Dijkstra said: "APL is a mistake, carried through to perfection. It is the language of the future for the programming techniques of the past: It creates a new generation of coding bums."

Coding bums! Well, I certainly have the "bum" part down. No wonder I relate to APL.

Jonathan Erickson

Editor-in-Chief

[email protected]

Terms of Service | Privacy Statement | Copyright © 2024 UBM Tech, All rights reserved.