# Difference between revisions of "APL"

(Importing text file) |
Ulf Rehmann (talk | contribs) m (tex encoded by computer) |
||

Line 1: | Line 1: | ||

− | APL denotes both a [[Programming language|programming language]] and a programming system. Its name simply abbreviates the title of [[#References|[a2]]], which presents the earliest version of APL as a language, i.e. the very concise mathematical Iverson notation. The first available APL system was IBM's APL | + | <!-- |

+ | a1106402.png | ||

+ | $#A+1 = 14 n = 0 | ||

+ | $#C+1 = 14 : ~/encyclopedia/old_files/data/A110/A.1100640 APL | ||

+ | Automatically converted into TeX, above some diagnostics. | ||

+ | Please remove this comment and the {{TEX|auto}} line below, | ||

+ | if TeX found to be correct. | ||

+ | --> | ||

+ | |||

+ | {{TEX|auto}} | ||

+ | {{TEX|done}} | ||

+ | |||

+ | APL denotes both a [[Programming language|programming language]] and a programming system. Its name simply abbreviates the title of [[#References|[a2]]], which presents the earliest version of APL as a language, i.e. the very concise mathematical Iverson notation. The first available APL system was IBM's APL $ \setminus $ | ||

+ | 360 (1966). It became soon popular, mainly because it was an interactive system designed to be used conversationally at typewriter terminals. It is strongly based on the Iverson notation without taking over all its features. APL exists in many dialects and versions, and most of them are extensions to APL $ \setminus $ | ||

+ | 360 [[#References|[a1]]]. | ||

APL is mainly a functional language, although it has also some imperative features. It is actually an array processing language, for all its non-trivial data structures are arrays and all its primitive functions and operators act on arrays. For the same reason, APL can also be considered a parallel language. The arrays in APL can be of any dimension and of variable size. However, in most dialects they have to be homogeneous and simple. These limitations, together with the lack of pointers, make it difficult to implement non-linear data structures (e.g. trees, graphs) in APL. It has no block structure, no explicit types and no explicit control structures. Loops can only be constructed by means of goto statements and should be avoided. Programs in APL are user-defined functions. All this makes programming in APL quite different from programming in imperative languages like FORTRAN, Pascal or C [[#References|[a4]]]. Each of the many primitive functions has an APL character as its name. At first sight, the APL character set and its semantics look strange, but actually they reflect a wise design. Another characteristic of APL is that compound statements are strictly executed from right to left. This means that no hierarchy among operations and much less parentheses are necessary. The following two compound statements illustrate some of the spirit of APL: | APL is mainly a functional language, although it has also some imperative features. It is actually an array processing language, for all its non-trivial data structures are arrays and all its primitive functions and operators act on arrays. For the same reason, APL can also be considered a parallel language. The arrays in APL can be of any dimension and of variable size. However, in most dialects they have to be homogeneous and simple. These limitations, together with the lack of pointers, make it difficult to implement non-linear data structures (e.g. trees, graphs) in APL. It has no block structure, no explicit types and no explicit control structures. Loops can only be constructed by means of goto statements and should be avoided. Programs in APL are user-defined functions. All this makes programming in APL quite different from programming in imperative languages like FORTRAN, Pascal or C [[#References|[a4]]]. Each of the many primitive functions has an APL character as its name. At first sight, the APL character set and its semantics look strange, but actually they reflect a wise design. Another characteristic of APL is that compound statements are strictly executed from right to left. This means that no hierarchy among operations and much less parentheses are necessary. The following two compound statements illustrate some of the spirit of APL: | ||

− | < | + | $$ |

+ | SUM \leftarrow + \setminus B \leftarrow 0 \ 4 { } ^ {-} 6 \ 8 < 7 \ 1 { } ^ {-} 2 \ 9.9 | ||

+ | $$ | ||

− | + | $$ | |

+ | D \leftarrow { \mathop{\rm DIAMETER} } { \mathop{\rm CONVEX} } { \mathop{\rm POLYGON} } X | ||

+ | $$ | ||

− | In the first example, two vectors are compared elementwise, resulting in a binary vector | + | In the first example, two vectors are compared elementwise, resulting in a binary vector $ B $ |

+ | of the same length. Then the elements of $ B $ | ||

+ | are added and the result ( $ = 3 $) | ||

+ | is assigned to $ SUM $. | ||

+ | In the second example, the variable $ X $ | ||

+ | is supposed to contain an array representing a sequence of points. The user-defined functions $ { \mathop{\rm DIAMETER} } $, | ||

+ | $ { \mathop{\rm CONVEX} } $ | ||

+ | and $ { \mathop{\rm POLYGON} } $ | ||

+ | are applied successively, and the resulting diameter is assigned to the variable $ D $. | ||

APL code is normally interpreted, not compiled. After a line has been entered, it is immediately interpreted and executed. This "desk calculator" property of APL enables efficient debugging. The implementation of algorithms in APL, often just for the purpose of rapid prototyping, is typically very fast. A further key element of the APL system are its work spaces, i.e. a simple mechanism for storing instances of variables and user-defined functions. | APL code is normally interpreted, not compiled. After a line has been entered, it is immediately interpreted and executed. This "desk calculator" property of APL enables efficient debugging. The implementation of algorithms in APL, often just for the purpose of rapid prototyping, is typically very fast. A further key element of the APL system are its work spaces, i.e. a simple mechanism for storing instances of variables and user-defined functions. | ||

− | Two influential followers of APL are APL2 (IBM, 1984) and J (Iverson and collaborator's, 1990) [[#References|[a1]]]. APL2 includes heterogeneous and nested arrays, whose absence in APL | + | Two influential followers of APL are APL2 (IBM, 1984) and J (Iverson and collaborator's, 1990) [[#References|[a1]]]. APL2 includes heterogeneous and nested arrays, whose absence in APL $ \setminus $ |

+ | 360 has often been strongly felt. J, which reflects Iverson's own further work on APL, introduces tacit programming. The system Mathematica, too, is strongly influenced by APL [[#References|[a5]]]. The "phenomenon" APL has always been controversial. At any rate, its influence on computer science, and especially on the development of programming languages, has been considerable [[#References|[a3]]]. | ||

====References==== | ====References==== | ||

<table><TR><TD valign="top">[a1]</TD> <TD valign="top"> G.F. (ed.) Hoffnagle, "13 papers on the occasion of the 25th anniversary of APL" ''IBM Systems J.'' , '''30''' : 4 (1991)</TD></TR><TR><TD valign="top">[a2]</TD> <TD valign="top"> K.E. Iverson, "A programming language" , Wiley (1962)</TD></TR><TR><TD valign="top">[a3]</TD> <TD valign="top"> K.E. Iverson, "Notation as a tool of thought, 1979 Turing Award Lecture" ''Comm. ACM 23'' (1980) pp. 444–465</TD></TR><TR><TD valign="top">[a4]</TD> <TD valign="top"> P. Wegner, "Programming languages — the first 25 years" ''IEEE Trans. Comp.'' , '''C–25''' (1976) pp. 1207–1225</TD></TR><TR><TD valign="top">[a5]</TD> <TD valign="top"> S. Wolfram, "Mathematica: A system for doing mathematics by computer" , Addison-Wesley (1988)</TD></TR></table> | <table><TR><TD valign="top">[a1]</TD> <TD valign="top"> G.F. (ed.) Hoffnagle, "13 papers on the occasion of the 25th anniversary of APL" ''IBM Systems J.'' , '''30''' : 4 (1991)</TD></TR><TR><TD valign="top">[a2]</TD> <TD valign="top"> K.E. Iverson, "A programming language" , Wiley (1962)</TD></TR><TR><TD valign="top">[a3]</TD> <TD valign="top"> K.E. Iverson, "Notation as a tool of thought, 1979 Turing Award Lecture" ''Comm. ACM 23'' (1980) pp. 444–465</TD></TR><TR><TD valign="top">[a4]</TD> <TD valign="top"> P. Wegner, "Programming languages — the first 25 years" ''IEEE Trans. Comp.'' , '''C–25''' (1976) pp. 1207–1225</TD></TR><TR><TD valign="top">[a5]</TD> <TD valign="top"> S. Wolfram, "Mathematica: A system for doing mathematics by computer" , Addison-Wesley (1988)</TD></TR></table> |

## Latest revision as of 18:47, 5 April 2020

APL denotes both a programming language and a programming system. Its name simply abbreviates the title of [a2], which presents the earliest version of APL as a language, i.e. the very concise mathematical Iverson notation. The first available APL system was IBM's APL $ \setminus $
360 (1966). It became soon popular, mainly because it was an interactive system designed to be used conversationally at typewriter terminals. It is strongly based on the Iverson notation without taking over all its features. APL exists in many dialects and versions, and most of them are extensions to APL $ \setminus $
360 [a1].

APL is mainly a functional language, although it has also some imperative features. It is actually an array processing language, for all its non-trivial data structures are arrays and all its primitive functions and operators act on arrays. For the same reason, APL can also be considered a parallel language. The arrays in APL can be of any dimension and of variable size. However, in most dialects they have to be homogeneous and simple. These limitations, together with the lack of pointers, make it difficult to implement non-linear data structures (e.g. trees, graphs) in APL. It has no block structure, no explicit types and no explicit control structures. Loops can only be constructed by means of goto statements and should be avoided. Programs in APL are user-defined functions. All this makes programming in APL quite different from programming in imperative languages like FORTRAN, Pascal or C [a4]. Each of the many primitive functions has an APL character as its name. At first sight, the APL character set and its semantics look strange, but actually they reflect a wise design. Another characteristic of APL is that compound statements are strictly executed from right to left. This means that no hierarchy among operations and much less parentheses are necessary. The following two compound statements illustrate some of the spirit of APL:

$$ SUM \leftarrow + \setminus B \leftarrow 0 \ 4 { } ^ {-} 6 \ 8 < 7 \ 1 { } ^ {-} 2 \ 9.9 $$

$$ D \leftarrow { \mathop{\rm DIAMETER} } { \mathop{\rm CONVEX} } { \mathop{\rm POLYGON} } X $$

In the first example, two vectors are compared elementwise, resulting in a binary vector $ B $ of the same length. Then the elements of $ B $ are added and the result ( $ = 3 $) is assigned to $ SUM $. In the second example, the variable $ X $ is supposed to contain an array representing a sequence of points. The user-defined functions $ { \mathop{\rm DIAMETER} } $, $ { \mathop{\rm CONVEX} } $ and $ { \mathop{\rm POLYGON} } $ are applied successively, and the resulting diameter is assigned to the variable $ D $.

APL code is normally interpreted, not compiled. After a line has been entered, it is immediately interpreted and executed. This "desk calculator" property of APL enables efficient debugging. The implementation of algorithms in APL, often just for the purpose of rapid prototyping, is typically very fast. A further key element of the APL system are its work spaces, i.e. a simple mechanism for storing instances of variables and user-defined functions.

Two influential followers of APL are APL2 (IBM, 1984) and J (Iverson and collaborator's, 1990) [a1]. APL2 includes heterogeneous and nested arrays, whose absence in APL $ \setminus $ 360 has often been strongly felt. J, which reflects Iverson's own further work on APL, introduces tacit programming. The system Mathematica, too, is strongly influenced by APL [a5]. The "phenomenon" APL has always been controversial. At any rate, its influence on computer science, and especially on the development of programming languages, has been considerable [a3].

#### References

[a1] | G.F. (ed.) Hoffnagle, "13 papers on the occasion of the 25th anniversary of APL" IBM Systems J. , 30 : 4 (1991) |

[a2] | K.E. Iverson, "A programming language" , Wiley (1962) |

[a3] | K.E. Iverson, "Notation as a tool of thought, 1979 Turing Award Lecture" Comm. ACM 23 (1980) pp. 444–465 |

[a4] | P. Wegner, "Programming languages — the first 25 years" IEEE Trans. Comp. , C–25 (1976) pp. 1207–1225 |

[a5] | S. Wolfram, "Mathematica: A system for doing mathematics by computer" , Addison-Wesley (1988) |

**How to Cite This Entry:**

APL.

*Encyclopedia of Mathematics.*URL: http://encyclopediaofmath.org/index.php?title=APL&oldid=15171