APL
APL (named after the book A Programming Language) is a programming language developed in the 1960s by Kenneth E. Iverson, distinguished by its use of non-ASCII special symbols to express operations on arrays and matrices. Renowned for its extreme conciseness and its treatment of arrays as first-class data objects, APL is widely regarded as one of the earliest and most influential array programming languages. Its notation allows complex computations—such as matrix inversion or statistical aggregation—to be expressed in a single line of code, leading to the characterization of APL programs as resembling mathematical notation executable on a computer.
Background
Kenneth E. Iverson, a Canadian computer scientist who joined Harvard University as an assistant professor of applied mathematics in the mid-1950s, initially developed what would become APL as a mathematical notation for teaching and research. His goal was to provide a consistent, precise notation for describing data processing algorithms, free from the inconsistencies of conventional mathematical conventions, which often use the same symbol for different operations or omit explicit rules for the order of evaluation.
The notation found early practical use at McKinsey & Company, where Iverson and colleagues applied it to modeling financial and logistics problems, demonstrating that a notation designed for exposition could also serve as a practical specification and computation tool. This experience established a key principle that would persist throughout APL's development: the notation should serve simultaneously as a means of thought, a medium of description, and an executable programming language.
Iverson later joined IBM, where he continued refining the notation. The culmination of this early work was the 1962 book A Programming Language, from which the language takes its name.
History
Origins and Development at IBM
Following the publication of A Programming Language, Iverson collaborated with Adin Falkoff and others at IBM's Yorktown Heights research center to formalize and implement the notation. In 1966, APL\360 was released for the IBM System/360 mainframe, and it became the definitive early implementation of the language. APL\360 was notable for operating as an interactive, time-sharing system at a time when batch processing was the norm, allowing programmers to type expressions and receive immediate results at a terminal.
The first formal public presentation of the language occurred in November 1962, and in 1964 Iverson's work received recognition; he subsequently received the ACM Turing Award in 1979, in part for his contributions embodied in APL and in programming notation generally.
Growth in the 1970s
The 1970s saw APL's rapid expansion, particularly within IBM and among corporations in finance, insurance, actuarial science, and scientific research. IBM released VSAPL for its mainframe operating systems, and APL terminals—keyboards bearing the distinctive APL symbols—became a familiar sight in data centers. Interactive computing itself was popularized in part through APL systems, with timesharing companies such as Scientific Time Sharing Corporation (STSC) offering commercial APL services.
During this period, Iverson and Falkoff emphasized the pedagogical power of the language. APL was used to teach mathematics and statistics to students at various levels, most famously in the experimental educational programs conducted with the assistance of APL as a computational medium.
Dialects and Extensions
Several important dialects emerged:
- APL\3000 was developed by Hewlett-Packard for the HP 3000 minicomputer.
- APL\700 and APL\68000 represented various implementations for different hardware platforms.
- APL2, developed by IBM under Falkoff's direction and released in 1984, extended the language with nested arrays—arrays whose elements could themselves be arrays of arbitrary structure. This extension resolved one of the major expressive limitations of classical APL and remains influential in modern implementations.
- Sharp APL, developed by STSC, introduced concepts such as shared variables, which allowed APL workspaces to communicate with external systems, an early form of interoperability that anticipated later client-server architectures.
In 1980, Iverson left IBM to join I. P. Sharp Associates, where he continued to drive the evolution of the language, later co-founding J (a successor language) with Roger Hui in the early 1990s.
Modern Era
Contemporary implementations have modernized APL considerably. Dyalog APL, first released in 1983 and actively developed since, has become one of the leading commercial implementations, introducing object-oriented features, support for Unicode, interfaces to external libraries, and sophisticated development environments. GNU APL provides a free and open-source implementation under the GNU Project. NARS2000 offers another open-source alternative with experimental extensions.
Iverson's later work on the languages J and, subsequently, Arthur Whitney's K language and its descendants (Q, and the kdb+ database system widely used in finance) form a direct lineage of array-oriented languages descending from APL, demonstrating the enduring vitality of the paradigm.
Main Characteristics
The APL Character Set
The most immediately distinctive feature of APL is its notation. The language employs several hundred special symbols, many originating from Kenneth Iverson's desire to unify mathematical notation. Classic examples include:
←for assignment (referred to in APL as "gets," not "equals")⍴(rho) for reshaping arrays or reporting their shape⌈and⌊(ceiling and floor) for maximum and minimum⍳(iota) for index generation⌽and⊖for rotation and reversal÷for division,×for multiplication or sign∘.for outer products, and+/for reduction (sum) via the/operator
Historically, these symbols required specialized terminals and keyboard overlays. Modern implementations leverage Unicode, allowing APL code to be entered and displayed on standard systems.
Arrays as the Central Data Structure
In APL, the array is the fundamental and universal data structure. All data are arrays: scalars are arrays of zero dimensions (rank 0), vectors are arrays of rank 1, matrices rank 2, and so forth, with support for arrays of up to fifteen or more dimensions in some implementations. Crucially, all primitive operations apply to whole arrays at once. The expression A + B adds entire matrices element-wise without explicit loops, and +/A sums the rows of a matrix through the application of the reduction operator to the addition function.
This pervasive array orientation eliminates most explicit control flow and iteration from typical APL programs, contributing both to their brevity and to their efficiency on vector-processing hardware and, later, on modern SIMD and parallel architectures.
Functions and Operators
APL distinguishes between functions, which act on data, and operators, which act on functions to produce derived functions. For example, / is an operator: given the function +, it produces the derived function +/ (insertion or reduction), and given ×, it produces ×/ (product). This systematic higher-order structure, present from the language's earliest days, anticipated functional programming concepts by several years and made APL one of the first practical languages with first-class treatment of function combinators.
Right-to-Left Evaluation
APL employs a simple, uniform evaluation rule: expressions are evaluated right to left, with all functions having equal precedence. This eliminates the need for operator precedence tables and parentheses in most expressions, though it requires readers to internalize the rule. Iverson argued that this uniformity was superior to conventional precedence hierarchies, which vary arbitrarily among mathematical conventions and programming languages.
Workspaces and the Interactive Environment
Classical APL organizes programs and data into workspaces—persistent, named collections of functions, variables, and system state that can be saved, loaded, and shared. Combined with the interactive session in which expressions are evaluated immediately upon entry, the workspace model fostered an exploratory, incremental style of programming and made APL systems suitable both for rapid prototyping and for large, long-lived commercial applications, particularly in actuarial and financial domains.
Natural-Language Influences and Documentation Style
Iverson promoted a method of documenting algorithms directly in executable APL notation rather than in prose or pseudo-code. His 1979 Turing Award lecture, "Notation as a Tool of Thought," articulated this philosophy, arguing that a well-designed notation enhances the intellectual work of formulating and solving problems. This essay remains a foundational text in the literature on programming language design.
Influence and Significance
Influence on Programming Language Design
APL's ideas have permeated much of modern computing. Its array-processing model influenced or prefigured features in MATLAB, Fortran 90's array syntax, NumPy in Python, Julia, R, and the array capabilities of numerous other systems. Its operators as higher-order functions anticipated constructs in functional languages, and its reduction and other combinators appear in modern data-processing frameworks. The direct descendants K, Q, and J sustain the tradition in specialized high-performance applications; kdb+ and its q language, built on K, are used extensively in financial time-series analysis.
Criticisms and Controversy
APL has been the subject of perennial debate. Critics have contended that its dense, symbol-heavy notation renders programs difficult to read and maintain without prior training—a concern captured in the so-called "write-only" characterization and echoed in later disparagements of "line noise" style programming. Proponents respond that APL is no harder to read than any foreign language for the untrained, and that its precision and brevity, once learned, confer substantial advantages in clarity and productivity. The debate over APL's readability has informed broader discussions about notation, abstraction, and the role of mathematics in programming.
Commercial and Institutional Legacy
APL sustained a commercial ecosystem of considerable durability: vendors such as Dyalog, APLNow (formerly APL2000), and others continue to support active user communities, and applications written in APL decades ago remain in production in insurance, finance, and engineering. Annual events such as the Dyalog user meeting and the Array conference, along with regular gatherings and online communities, attest to the language's continued practice.
Recognition
Kenneth E. Iverson received the ACM Turing Award in 1979, largely in recognition of APL and his broader contributions to programming notation. The Harry Goode Memorial Award and other honors also acknowledged this work. APL is frequently cited in histories of computing as a landmark demonstration that a programming language could closely mirror mathematical thought, and as the progenitor of the entire family of array languages.
Selected Technical Features
Modern APL dialects typically provide, in addition to classical primitives:
- Nested arrays (APL2 and descendants), permitting hierarchically structured data.
- Complex numbers and rational arithmetic in some implementations.
- Direct functions (dfns) in Dyalog APL, a modern functional programming style with lexical scoping embedded within the language.
- Object-oriented extensions, namespaces, and interfaces to C, .NET, and other environments.
- Unicode support, enabling the full APL character set on standard hardware.
A frequently cited example of APL's expressiveness is the "game of life" one-liner attributed to John Scholes, which implements Conway's Game of Life in a single short expression, illustrating the language's capacity to capture complex iterative algorithms concisely.
See Also
- Kenneth E. Iverson
- J (programming language)
- K (programming language)
- Array programming
- Q (programming language from Kx Systems)
You May Be Interested In
Sichuan
Sichuan is a landlocked province in southwest China, bordered by Qinghai and Gansu to the north, Shaanxi and Chongqing t...
Abugida
An abugida is a type of writing system in which the basic unit of notation is a consonant–vowel sequence: each consonant...
Geography of Antarctica
Antarctica is Earth’s southernmost continent, a vast, ice-covered landmass centered on the South Pole and surrounded by...
André Gide
André Paul Guillaume Gide (22 November 1869 – 19 February 1951) was a French novelist, essayist, dramatist, and diarist...
Related Articles
Architect
An architect is a trained, licensed professional who plans, designs, and oversees the construction of buildings and othe...
Algorithm
An algorithm is a finite sequence of well-defined, unambiguous instructions that, when carried out, solves a class of pr...
Analysis
Analysis (from the Greek analusis, meaning "a breaking up" or "a loosening") is the process of deliberately separating a...
ASCII
ASCII (American Standard Code for Information Interchange), pronounced "ass-kee," is a character encoding standard for e...
Comments (0)
No comments yet. Be the first to comment!