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
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:
| |
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:
| |
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:
| Implementation | License | Platforms | Notes |
|---|---|---|---|
| Dyalog APL | Commercial | All | Most feature-rich, enterprise-grade |
| GNU APL | GPL | Linux, macOS | Free software implementation |
| APLX | Commercial | All | Focuses on portability |
| ngn/apl | MIT | Browser | JavaScript 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:
| |
Continue to the Hello World tutorial to write your first APL expression.
Timeline
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
Influenced
Running Today
Run examples using the official Docker image:
docker pull juergensauermann/gnu-apl-1.8:latestExample usage:
docker run --rm -v $(pwd):/app -w /app juergensauermann/gnu-apl-1.8 apl --silent --noColor --noCIN -f hello.apl