Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Design

APLs and Oranges


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]


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.