APL

Xuan Peng
Ecosystèmes des langages de programmation
3 min readMar 25, 2017

APL is a programming language which was named after the book A programming Language written by Kenneth E. Iverson.[1]

At the very beginning, APL was not a computer programming language. Instead, it was a mathematical notation created by Iverson in 1957 and was called Iverson Notation. This notation was widely used in documenting and analysing an algorithm.

In 1966, it was finally developed into a computer programming language by Iverson’s team. Take two simple examples as below.

4 2 3 + 8 5 7    @The result of this line: 12 7 10
'hello world' @The result of this line: hello world
@ in APL signifies a comment

Features

What made APL so different from other computer programming languages at that time?

First, it’s mathematical. In order to adapt the notation to a keyboard-based computer programming language, they gave up the labeled arrows which indicate a “jump”. A feature kept for APL was the special mathematical symbols for the primitive functions. For example, APL uses (÷) instead of (/). The symbols allow programmers to express a long math function in a short line of code.

Second is its automatic creation of vectors and arrays. Multi-dimensional structures are created and returned when an expression is calculated. An APL programmer doesn’t need to declare any variables in the code regardless of the shape or size of an assignment.

The third feature is based on the two above. APL is an interpretive language but not a compiled one due to its flexible variables. When an APL program is running, the interpreter will check the codestring and will dynamically allocate the memory.

Applications

Even before APL became a real computer programming language, Iverson Notation had been used widely as a language to document an algorithm. After IBM System Journal [2] was published in 1965, it became more and more popular in developing applications of science, calculation and finance.

Even today, some companies in the field of Insurance or Statics are still using it to deal with some mathematical programming.

Conclusion

In one way, APL was and still is criticized for using a series of unusual and terse symbols. But in another, APL can implement a complicated algorithm in several symbols while other programming languages may have to be in several pages. Picture below shows John Conway’s Game of Life in APL.[3]

The APL program is so mysterious that some people jokingly call APL a write-only language. Even the writer may have some trouble in understanding his own APL code after one month.

Although APL doesn’t look very useful in our times, it was revolutionary and still represents an incredible programming idea today.

References

[1] K. E. Iverson, A Programming Language, John Wiley and Sons, Inc. 1962, ISBN 0–471–43014–5.

[2] IBM Systems Journal, vol. 30, no. 4, 1991.

[3] Len Shustek,The APL Programming Language Source Code, http://www.computerhistory.org/atchm/the-apl-programming-language-source-code/.

--

--