This programming language was developed by Harvard (later IBm) researcher Kenneth E. Iverson in the early 1960s as a way to express mathematical functions clearly and consistently for computer use. The power of the language to compactly express mathematical functions attracted a growing number of users, and APL soon became a full general-purpose computing language.
Like many versions of BASIC, APL is an interpreted language, meaning that the programmer’s input is evaluated “on the fly,” allowing for interactive response (see inteRpReteR). Unlike BASIC or FORTRAN, however, APL has direct and powerful support for all the important mathematical functions involving arrays or matrices (see aRRay).
APL has over 100 built-in operators, called “primitives.” With just one or two operators theprogrammer can perform complex tasks such as extracting numeric or trigonometric functions, sorting numbers, or rearranging arrays and matrices. (Indeed, APL’s greatest power is in its ability to manipulate matrices directly without resorting to explicit loops or the calling of external library functions.)
To give a very simple example, the following line of APL code:
x [D x]
sorts the array x. In most programming languages this would have to be done by coding a sorting algorithm in a dozen or so lines of code using nested loops and temporary variables.
However, APL has also been found by many programmers to have significant drawbacks. Because the language uses greek letters to stand for many operators, it requires the use of a special type font that was generally not available on non-IBm systems. A dialect called J has been devised to use only standard ASCII characters, as well as both simplifying and expanding the language. many programmers find mathematical expressions in APL to be cryptic, making programs hard to maintain or revise. Nevertheless, APL Special Interest groups in the major computing societies testify to continuing interest in the language.
No comments:
Post a Comment