Est. 1966 Advanced

APL

A Programming Language - the revolutionary array-oriented language with unique mathematical notation that influenced modern data science and functional programming.

Created by Kenneth E. Iverson at IBM

Paradigm Array-Oriented, Functional, Tacit (point-free)
Typing Dynamic, Strong
First Appeared 1966
Latest Version Dyalog APL 19.0 (2023), GNU APL 1.8

APL (A Programming Language) represents one of the most radical departures from conventional programming language design. Its use of special symbols to represent powerful array operations allows expressing complex algorithms in remarkably few characters. What might take pages of code in other languages can often be written in a single line of APL.

History & Origins

The story of APL begins not with computers, but with a frustrated mathematics professor. In the late 1950s, Kenneth Iverson was teaching at Harvard when he became dissatisfied with conventional mathematical notation for describing algorithms. He developed his own notation system, originally called “Iverson Notation.”

When Iverson joined IBM in 1960, he and Adin Falkoff worked to formalize this notation. The 1962 book “A Programming Language” gave the notation its name and laid out its theoretical foundations. Remarkably, the language was specified before any implementation existed.

The first APL interpreter ran on an IBM System/360 in 1966, and by 1968, APL\360 was commercially available. The language gained devoted followers in scientific, financial, and actuarial fields where its array operations matched problem domains perfectly.

The Turing Award

In 1979, Kenneth Iverson received the ACM Turing Award - computing’s highest honor - for “his pioneering effort in programming languages and mathematical notation resulting in what the computing field now knows as APL, for his contributions to the implementation of interactive systems, to educational uses of APL, and to programming language theory and practice.”

Why APL is Unique

The Character Set

APL uses a specialized character set with symbols like (iota), (rho), (rotate), and (grade up). These aren’t decorations - each symbol is a complete operation. Where other languages might need a function name and parentheses, APL uses a single character.

Original APL required special keyboards with these symbols. Modern implementations allow typing keywords that convert to symbols, or using standard Unicode input methods.

Array-Oriented Thinking

In APL, operations naturally apply to entire arrays without explicit loops:

1
2
      2 × 1 2 3 4 5
2 4 6 8 10

This single expression multiplies every element by 2. No loop declarations, no iterator variables, no off-by-one errors.

Right-to-Left Evaluation

APL evaluates expressions strictly from right to left, with all operators having equal precedence:

1
2
      2 × 3 + 4
14

This reads as “2 times (3 plus 4)” = 14, not “(2 times 3) plus 4” = 10.

Implicit Iteration

Many APL operations implicitly iterate over their arguments. This eliminates most loops and enables a highly declarative style where you describe what you want, not how to compute it.

APL’s Influence

APL’s ideas permeate modern computing:

  • NumPy and Python data science: Array broadcasting, vectorized operations
  • MATLAB: Matrix-first design, concise array syntax
  • R and S: Statistical array operations
  • Julia: Multiple dispatch, array-oriented design
  • J, K, and Q: Direct APL descendants used in quantitative finance
  • Functional programming: Point-free (tacit) style, function composition

When you write numpy.array([1,2,3,4,5]) * 2 in Python, you’re using ideas Kenneth Iverson pioneered in 1962.

Modern APL

Several APL implementations are actively maintained:

ImplementationLicensePlatformsNotes
Dyalog APLCommercialAllMost feature-rich, enterprise-grade
GNU APLGPLLinux, macOSFree software implementation
APLXCommercialAllFocuses on portability
ngn/aplMITBrowserJavaScript implementation

For this tutorial series, we use GNU APL through Docker for easy setup.

The APL Community

APL has an unusually dedicated community. Annual conferences (APL2000, Dyalog User Meeting) draw practitioners from finance, actuarial science, and academia. The APL Wiki and TryAPL provide modern resources for learning.

Getting Started

APL programs are typically stored in .apl files or as workspace files (.dws in Dyalog). The typical workflow in modern APL:

1
2
3
4
5
# Run an APL script
apl --script hello.apl

# Start interactive session
apl

Continue to the Hello World tutorial to write your first APL expression.

Timeline

1957
Kenneth Iverson develops mathematical notation for describing algorithms at Harvard
1960
Iverson joins IBM to formalize his notation
1962
'A Programming Language' book published, giving APL its name
1966
First working APL interpreter implemented on IBM System/360
1968
APL\360 becomes commercially available
1973
APL2 development begins at IBM, adding nested arrays
1979
Iverson receives Turing Award for APL
1983
Dyalog APL founded in UK
1990
J language announced as APL successor by Iverson
2013
GNU APL released as free software implementation

Notable Uses & Legacy

Financial Services

Major banks and trading firms use APL for real-time risk analysis, derivatives pricing, and quantitative modeling due to its concise array operations.

Statistics Canada

Used APL extensively for census data processing and statistical analysis, handling massive datasets with minimal code.

NASA

Early adopter for scientific computing, trajectory calculations, and data analysis in space missions.

Insurance Industry

Actuarial calculations and risk modeling in companies like Swiss Re and Munich Re leverage APL's array processing capabilities.

Research & Academia

Used for mathematical research, algorithm development, and teaching computational thinking due to its close alignment with mathematical notation.

Language Influence

Influenced By

Mathematical notation Speedcoding

Influenced

J K Q MATLAB NumPy R S Julia Nial A+

Running Today

Run examples using the official Docker image:

docker pull juergensauermann/gnu-apl-1.8:latest

Example usage:

docker run --rm -v $(pwd):/app -w /app juergensauermann/gnu-apl-1.8 apl --silent --noColor --noCIN -f hello.apl

Topics Covered

Last updated: