creators
Ken Iverson et al, at IBM.
papers & manuals
n.a.
software
APL
versions
APL\360, APL SV, VS APL, Sharp APL, Sharp APL/PC, APL2, APL*PLUS, APL*PLUS/PC, APL*PLUS/PC II, MCM APL, Honeyapple, DEC APL.
. see also
J, S, Matlab
keywords
interpreter language mathemetics statistics |
Description
APL stands for "A Programming Language." It was created in the 1960's by Ken Iverson and his colleagues at IBM. The language was very much mathematically inspired and used a powerful notation for mathematical algorithms. Therefore APL uses non-ASCII (or non-EBCDIC) symbols, including some Greek letters. So eg the character "X" differs from the arithmetic operation multiply "x" ; the arithmetic operation "devide" is not a "/" but has its own character "a horizontal line and a dot above and below that line" (see below).
APL is a interactive, array and matrices oriented language. Compilers are available. There isn't even an IF statement, although branching is possible, but that should be avoided. In APL, all expressions are evaluated from right to left. A few simple APL statements will give a feeling for the language:
|
assignement, assign the values 10 22 25 33 to the variable COSTS; so the variable COSTS is a vector containing 4 values |
|
reduce-function, reads as "sum over COSTS", take the plus-reduction-of-variable COSTS, or just calculate the sum of all elements in vector COSTS |
|
reduce-function, but now use multiply, reads as "mutiply over COSTS" |
|
assignement using the rho-function, which define a matrix; variable COSTS2 will be a matrix of 2 rows and 4 columns and gets values 11 ... 12 |
|
the rho-function is used monadic, this means that there is only a right argument and not, as in above example, a right and a left argument (used dyadic); this monadic function wil give the number of rows and columns, so the result is a vector |
|
do a "multiply over the result of a monadic rho over COSTS2"; this means give the total number of elements in COSTS2 |
|
the "rho over COSTS" gives the number of elements in COSTS, the "sum over COSTS" gives the total sum over all elements; divede these two and it gives the total average |
|
the "rho over matrix COSTS2" gives the number of rows and columns; the "multiply over this result" gives the total number of elements in the matrix; the "plus over the matrix COSTS2" gives the sum per row, so two values; the sum over that result gives the total sum, etc. |
This just gives a feeling for APL. There are a lot of powerfull monadic and dyadic functions, which make it possible to program in a very compact way. For a mathematician it is a perfect language, but the level of abstraction is very often too high for most "normal" programmers. Another example:
|
This line of code calculates the prime numbers from 2 to the starting value of R, in this example 20.
the "iota funtion" of R filles a vector (and that will be R again) with numbers from 1 to the value of the variable (20 in this example), the first element is dropped (that is the 1); so to the right of the "/" there will be 2 3 4 5 ... 18 19 20
the "small.circle-dot-multiply" defines an outer product so all elements of R are multiplied by all elements of R giving a matrix; check whether elements of R are in the matrix and make a vector containing "1"-s at the place where that is true and "0"-s where that is not true
inverse that vector and use it to grab that elements from R using the "over" function |
If you like this, go and enjoy APL. If not, no problem, and forget this language. Because of the compact style, maintenance of old programs is very often a hard job. Nowadays one finds APL on nearly all computers, whether micro, mini or mainframe [1].
Notwithstanding its age, many ideas in APL are still unique, while others have found their way into other programming languages. Eg "inverted files" are sold as a new technology for data warehousing and data mining, but APLDI used this technology in the 1970-s. A inverted files can not only read rows of a table as records, but can also read columns as records.
Links
The largest archive of APL and J software can be found at Waterloo University. Interpreters, workspaces, information, and more! [2].
There are a lot of APL associations, clubs, etc. The community seemes small, but has a high spirit. Look at site from eg the British APL Association , the Finnish APL Association , etc, A fine overview of associations, vendors, books, etc can be found at all these sites and on a lot of personal sites, eg Jim W's APL Information . These links proof the theorem, "Once an APL programmer, always an APL addict".
Specifications
see above
Chronology
- 1964 - Mr. Kenneth Iverson invented a notation to help him delivering an EDP lecture called "Automatic Data Processing" in years 1955 to 1960 at Harvard University. This interesting notation has been first turned into APL in the early 60's when Ken joined IBM.
- 1966 - APL was implemented on the IBM 360 mainframe series in 1966 as an interpretative language together with its own time-sharing system. So APL a rather old language along with languages like ALGOL (1958), Basic (1965), COBOL (1960), Fortran (1953) and PL/I (1965).
- 1969 - STSC ( Scientific Time-Sharing Corporation ) is created with some of the people who originally implemented APL as a language at IBM.
- 1970 - STSC creates APL*PLUS , a new version of the APL language with many extensions oriented toward allowing to develop business applications. APL*PLUS includes a very powerful file system using such functions as FCREATE , FTIE , FAPPEND , FREAD , FFREPLACE ...
- 1979 - Name changed to STSC, Inc.
- 1982 - APL language at the PC. Since 1966 APL has been implemented on many computers, mainly large mainframes like those of Burroughs, IBM and Siemens. Initially APL missed the proliferation of microcomputers because APL needed more power (storage as well as speed) than was available in those early years. Very few of those early microcomputers had APL; exceptions were Tandy's TRs90 and Commodore's PET. It was the rise of the more powerful 16-bits micro computers that enabled APL to settle commercially on microcomputers. APL*PLUS PC version 1 , the first version of an APL on the PC is introduced by STSC
APL*PLUS PC was launched in 1982 and was highly compatible with APL*PLUS Mainframe. It was delivered with a number of utility workspaces which were also available on the mainframe.
APL*PLUS PC was a DOS application, limited to 640 K. in 1982 STSC Acquired by Continental Telecom Inc.
- 1984 - APL2: This new version had a major extension: nested arrays. Up to then arrays always had scalar elements (numbers of characters). In the N.A. version (Nested Array version) each array-element can be an array itself (which in turn ....).
- 1985???? Start of J, a language based on APL, but ... ETC
- 1992 - STSC Name changed to Manugistics
- 1993 - Manugistics Group, Inc. initial public offering
- 1995 - Manugistics sold PC and UNIX versions of APL*PLUS to LEX2000 Financial Reporting Software, which then created a subsidiary named APL2000 ; products renamed APL+
- 1999 - Cognos acquired LEX2000 and APL2000
|