APL
APL grew out of a paper Ken Iverson proposed at a mathematics conference. The gist of the paper was that mathematics texts are hard to read because of the variations in syntax used by various authors. Iverson proposed a APL (A Programming Language) as a consistent, easy to follow sytax for future texts.
Obvious Wikipedia links:
Iverson first devised the idea behind APL while teaching Harvard MBA students mathematics. He noticed that once they all understood the notation used in the book, the teaching became easier. He realized that the many different syntaxes used across various mathematical texts.
Iverson developed a syntax for mathematics and wrote a paper about that notation. The paper was warmly received at a conference with the exception that everyone thought their notation should be used rather than his.
Iverson later went to IBM on a sabatical. There he joined an engineer he knew and was free to work on whatever he wanted. Thye decided to turn APL into a computer programming language.
The first issue, was that APL used many symbols and greek characters. Iverson insisted that the computer/keyboard display and print these. Eventually, they developed a spherical shape with all of the symbols and regular characters (multiple rows wrapping all the way around). This design became the basis for the IBM Selectric Typewriter.
Examples:
m1 ← 3 3 ⍴ ⍳ 9
a
1 2 3 4 5
+/a
15
id←(⍳3)∘.=⍳3
id
1 0 0
0 1 0
0 0 1
m1 ← 3 3 ⍴ ⍳ 9
m1
1 2 3
4 5 6
7 8 9
m1 +.× id
1 2 3
4 5 6
7 8 9
m1 +.× m1
30 36 42
66 81 96
102 126 150
v1 ← ⍳ 9
v1
1 2 3 4 5 6 7 8 9
v1 ∘.+ v1
2 3 4 5 6 7 8 9 10
3 4 5 6 7 8 9 10 11
4 5 6 7 8 9 10 11 12
5 6 7 8 9 10 11 12 13
6 7 8 9 10 11 12 13 14
7 8 9 10 11 12 13 14 15
8 9 10 11 12 13 14 15 16
9 10 11 12 13 14 15 16 17
10 11 12 13 14 15 16 17 18
v1 ∘.× v1
1 2 3 4 5 6 7 8 9
2 4 6 8 10 12 14 16 18
3 6 9 12 15 18 21 24 27
4 8 12 16 20 24 28 32 36
5 10 15 20 25 30 35 40 45
6 12 18 24 30 36 42 48 54
7 14 21 28 35 42 49 56 63
8 16 24 32 40 48 56 64 72
9 18 27 36 45 54 63 72 81
v1 ∘.- v1
0 ¯1 ¯2 ¯3 ¯4 ¯5 ¯6 ¯7 ¯8
1 0 ¯1 ¯2 ¯3 ¯4 ¯5 ¯6 ¯7
2 1 0 ¯1 ¯2 ¯3 ¯4 ¯5 ¯6
3 2 1 0 ¯1 ¯2 ¯3 ¯4 ¯5
4 3 2 1 0 ¯1 ¯2 ¯3 ¯4
5 4 3 2 1 0 ¯1 ¯2 ¯3
6 5 4 3 2 1 0 ¯1 ¯2
7 6 5 4 3 2 1 0 ¯1
8 7 6 5 4 3 2 1 0
1 0 2 0 0 0 1 / 'snowman'
soon
Useful Links:
- Dyalog - APL Interpreter
- Try APL
- IBM Selectric Typewriter
- Dyalog Documentation
- Documentation
- APL Lznguage Reference Guide (831 pages)
- APL Programming Guide (350 pages)
- Terminology: Functions and Operators
YouTube links for APL