Discovering APL: Difference between revisions

Jump to navigation Jump to search
71 bytes added ,  22:17, 10 September 2022
m
Text replacement - "</source>" to "</syntaxhighlight>"
Miraheze>Adám Brudzewsky
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
:''A brief review of APL, its origins and what makes it distinctive.'' By Stephen Taylor.
:''A brief review of APL, its origins and what makes it distinctive.'' By [[Stephen Taylor]] (lightly edited for [[APL Wiki]]).


== Origins ==
== Origins ==


Early programming languages were designed to control what computers do. At Harvard in the 1950s Ken Iverson was revising traditional mathematical notation. He wanted a consistent language for describing operations on arrays, a notation a machine could interpret.
Early programming languages were designed to control what computers do. At Harvard in the 1950s [[Ken Iverson]] was revising traditional mathematical notation. He wanted a consistent language for describing operations on arrays, a notation a machine could interpret.


Iverson was a key member of the early computer science community. At Harvard with [[Wikipedia:Howard Aiken|Howard Aiken]] he taught the world’s first classes on computing. When he published his math notation, he titled the book ''[[A Programming Language]]'' (Wiley, New York, 1962). His teaching assistant at Harvard, [[Wikipedia:Fred Brooks|Fred Brooks]], author of ''[[Wikipedia:The Mythical Man-Month|The Mythical Man-Month]]'', was [[IBM]]’s project manager for the development of OS/360, its first multi-tasking operating system. (OS/360 was the first operating system ever [https://web.archive.org/web/20070710100707/http://www.research.ibm.com/journal/sj/032/falkoff.pdf described formally] — in [[Iverson notation]], of course.) Iverson also went to IBM, who made him a Research Fellow, and [[APL\1130|implemented his notation on an 1130 computer]], where it was dubbed APL after the title of his book. APL\1130 was providing personal computing to a community of users well before OS/360 came to life.
Iverson was a key member of the early computer science community. At Harvard with [[Wikipedia:Howard Aiken|Howard Aiken]] he taught the world’s first classes on computing. When he published his math notation, he titled the book ''[[A Programming Language]]'' (Wiley, New York, 1962). His teaching assistant at Harvard, [[Wikipedia:Fred Brooks|Fred Brooks]], author of ''[[Wikipedia:The Mythical Man-Month|The Mythical Man-Month]]'', was [[IBM]]’s project manager for the development of OS/360, its first multi-tasking operating system. (OS/360 was the first operating system ever [https://web.archive.org/web/20070710100707/http://www.research.ibm.com/journal/sj/032/falkoff.pdf described formally] — in [[Iverson notation]], of course.) Iverson also went to IBM, who made him a Research Fellow, and [[APL\1130|implemented his notation on an 1130 computer]], where it was dubbed APL after the title of his book. APL\1130 was providing personal computing to a community of users well before OS/360 came to life.
Line 19: Line 19:
== Why vector languages? ==
== Why vector languages? ==


Distinct from [[Object orientated programming|object-orientation]], currently the most popular abstraction paradigm for software developers, array-orientation is an older paradigm, closely associated with functional programming, that offers different powers. Just as Vector languages have been extended to facilitate object-oriented programming, so array-oriented extensions are available for OO languages such as Java and C++. From the Vector languages, OO programmers can learn powerful techniques.
Distinct from [[Object-oriented programming|object-orientation]], currently the most popular abstraction paradigm for software developers, array-orientation is an older paradigm, closely associated with functional programming, that offers different powers. Just as Vector languages have been extended to facilitate object-oriented programming, so array-oriented extensions are available for OO languages such as Java and C++. From the Vector languages, OO programmers can learn powerful techniques.


Interpreters for the Vector languages have always had managed code (managing machine details), to let the programmer focus on more abstract issues. Their low housekeeping and interactive development environments make them languages of choice for many programmers pressed for time. Not surprisingly, Vector languages have a long association with agile or lightweight software development.
Interpreters for the Vector languages have always had managed code (managing machine details), to let the programmer focus on more abstract issues. Their low housekeeping and interactive development environments make them languages of choice for many programmers pressed for time. Not surprisingly, Vector languages have a long association with agile or lightweight software development.
Line 31: Line 31:
== A Shocking Brevity ==
== A Shocking Brevity ==


APL (A Programming Language) takes its name from [[A Programming Language|the eponymous book]] in which [[Ken Iverson]], then teaching mathematics at Harvard, introduced his revised notation for linear algebra. From Harvard he became an IBM Fellow. At IBM, ‘[[Iverson notation]]’ became A Programming Language, distinguished by a shocking brevity.
APL (A Programming Language) takes its name from [[A Programming Language|the eponymous book]] in which Ken Iverson, then teaching mathematics at Harvard, introduced his revised notation for linear algebra. From Harvard he became an IBM Fellow. At IBM, ‘[[Iverson notation]]’ became [[A Programming Language]], distinguished by a shocking brevity.


This brevity originates in
This brevity originates in


* applying functions to arrays of values, abstracting away the work of controlling loops and counters;
* applying functions to arrays of values, abstracting away the work of controlling loops and counters;
* single-character glyphs used to represent primitive functions;
* single-character [[glyph]]s used to represent primitive functions;
* weak data-typing, so that a small number of powerful primitive functions generalise over many kinds of data.
* weak data-typing, so that a small number of powerful primitive functions generalise over many kinds of data.


Line 43: Line 43:
=== Unusual Symbols ===
=== Unusual Symbols ===


The single-character APL [[glyph]]s have frequently been cited as evidence of APL being unintelligible, or “a write-only language”. This can also be said of any unfamiliar language (do [[Wikipedia:Regular expression|Regular expression]]s attract similar comment?)
The single-character APL [[glyph]]s have frequently been cited as evidence of APL being unintelligible, or “a write-only language”. This can also be said of any unfamiliar language (do [[Wikipedia:regular expression|regular expression]]s attract similar comment?)


The glyphs are largely unnecessary and can easily be replaced by reserved words. This can be helpful for a novice who wishes to separate learning syntax and semantics from mastering a keyboard mapping. However most writers prefer the ‘power shorthand’. For example:
The glyphs are largely unnecessary and can easily be replaced by reserved words. This can be helpful for a novice who wishes to separate learning syntax and semantics from mastering a keyboard mapping. However most writers prefer the ‘power shorthand’. For example:


<source lang=apl>+⌿÷≢</source>
<syntaxhighlight lang=apl>+⌿÷≢</syntaxhighlight>


rather than
rather than


<source>sum divide tally</source>
<pre>sum divide tally</pre>


The density of APL expressions helps writers identify and accumulate abstractions, a crucial part of [[Wikipedia:refactoring|refactoring]].
The density of APL expressions helps writers identify and accumulate abstractions, a crucial part of [[Wikipedia:refactoring|refactoring]].
Line 83: Line 83:
The wheel continues to turn. The Internet has spread and connected PCs across many linguistic systems and scripts. Operating systems now routinely support not just multiple fonts but multiple writing systems and keyboard mappings to use them. The PC on which I am writing this has its browsers configured to display HTML pages in Western European languages, in Turkish, Japanese and Korean.
The wheel continues to turn. The Internet has spread and connected PCs across many linguistic systems and scripts. Operating systems now routinely support not just multiple fonts but multiple writing systems and keyboard mappings to use them. The PC on which I am writing this has its browsers configured to display HTML pages in Western European languages, in Turkish, Japanese and Korean.


After its initial fascination with graphic design, web design now looks more like typography. My mouse rests upon a mousemat that shows me how to key the extended Western Latin ASCII characters less easily reached from the keyboard. (Or see Bringhurst’s ingenious mapping in ''The Elements of Typographic Style''<ref>[[http://www.amazon.co.uk/exec/obidos/ASIN/0881791326/5jt-21/026-0122895-4126017|The Elements of Typographic Style]] Robert Bringhurst, Version 2.5, 2002, Hartley & Marks, Vancouver BC, Canada. ISBN 0 88179 132 6</ref> and my review of it.<ref>''The Solid Form of Language'' Robert Bringhurst, 2004, Gaspereau Press, Kentsville NS, Canada. ISBN 1 894031 88 1 · Reviewed in ''Vector'' 21.2 [[http://archive.vector.org.uk/art10009840|“Liquid Mathematics”]]</ref>) My girlfriend manages to use Macintosh and Windows mappings for Japanese without a diagram. I can usually manage the same for APL, but have a diagram above my monitor for when I can’t.
After its initial fascination with graphic design, web design now looks more like typography. My mouse rests upon a mousemat that shows me how to key the extended Western Latin ASCII characters less easily reached from the keyboard. (Or see Bringhurst’s ingenious mapping in ''The Elements of Typographic Style''<ref>[http://www.amazon.co.uk/exec/obidos/ASIN/0881791326/5jt-21/026-0122895-4126017 The Elements of Typographic Style] Robert Bringhurst, Version 2.5, 2002, Hartley & Marks, Vancouver BC, Canada. ISBN 0 88179 132 6</ref> and my review of it.<ref>''The Solid Form of Language'' Robert Bringhurst, 2004, Gaspereau Press, Kentsville NS, Canada. ISBN 1 894031 88 1 · Reviewed in ''Vector'' 21.2 [http://archive.vector.org.uk/art10009840 “Liquid Mathematics”]</ref>) My girlfriend manages to use Macintosh and Windows mappings for Japanese without a diagram. I can usually manage the same for APL, but have a diagram above my monitor for when I can’t.


=== Signs of the times ===
=== Signs of the times ===
Line 89: Line 89:
Contemporary inscribing technology supports multiple languages and writing systems. (A Japanese web page will casually mix three to five different scripts.) The elegant and distinctive glyphs of APL are by no means the most exotic writing system my PC supports today.
Contemporary inscribing technology supports multiple languages and writing systems. (A Japanese web page will casually mix three to five different scripts.) The elegant and distinctive glyphs of APL are by no means the most exotic writing system my PC supports today.


Iverson insisted upon the importance of his notation as a tool of thought. Similarly, Paul Graham has written of [[http://www.paulgraham.com/hp.html|coding as an essential part]] of exploration and design. The terse and distinctive signs of APL increase its utility, but only if they can be typed as well as written.
Iverson insisted upon the importance of his notation as a tool of thought. Similarly, Paul Graham has written of [http://www.paulgraham.com/hp.html coding as an essential part] of exploration and design. The terse and distinctive signs of APL increase its utility, but only if they can be typed as well as written.


Recent technology made APL’s glyphs relatively inaccessible, and correspondingly less useful as a tool of thought. Current technology makes them once again accessible, and more useful than they have been for decades.
Recent technology made APL’s glyphs relatively inaccessible, and correspondingly less useful as a tool of thought. Current technology makes them once again accessible, and more useful than they have been for decades.
Line 95: Line 95:
== References ==
== References ==
<references />
<references />
[[Category:Essays]]

Navigation menu