| • Science | • People | • Locations | • Timeline |
| Contents | ||
Array Processing Language) is an array programming language invented in 1962 by Kenneth E. Iverson while at Harvard University. Iverson received the Turing Award in 1979 for his work. As with all programming languages that have had several decades of continuous use, APL has changed significantly from the original language described by Iverson in his book A Programming Language in 1963. One thing that has remained constant is the interpretive nature of the APL programming environment, a feature much appreciated by its users. Conversely, its initial lack of support for both structured and modular programming has been solved by all the modern APL incarnations. One much criticized aspect still remains, though: the use of a non-standard character set (see Character set below.)
Over a very wide set of problem domains (math, science, engineering, computer design, robotics, data visualization, actuarial science, traditional DP, etc.) APL is an extremely powerful, expressive and concise programming language, typically set in an interactive environment. It was originally created as a way to describe computers, by expressing mathematical notation in a rigorous way that could be interpreted by a computer. It is easy to learn but APL programs can take some time to understand. Unlike traditional structured programming languages, code in APL is typically structured as chains of monadic or dyadic functions and operators acting on arrays. Because APL has so many nonstandard operators, APL does not have function or operator precedence. The original APL did not have control structures (loops, if-then-else), but the array operations it included could simulate structured programmingStructured programming can be seen as a subset or subdiscipline of procedural programming, one of the major programming paradigms. It is most famous for removing or reducing reliance on the GOTO statement (also known as "go to"). Historically, several dif constructs. For example, the iota operator (which yields an array from 1 to N) can simulate for-loop iterationIteration is the repetition of a process, typically within a computer program. Confusingly, it can be used both as a general term, synonymous with repetition, and to describe a specific form of repetition with mutable state. When used in the first sense,.
The APL environment is called a workspace. In a workspace the user can define programs and data, i.e. the data values exist also outside the programs, and the user can manipulate the data without the necessity to define a program, for example:
Assign the vectorA vector in physics and engineering typically refers to a quantity that has close relationship to the spatial coordinates, informally described as an object with a "magnitude" and a "direction". The word vector is also now used for more general concepts ( values 4 5 6 7 to N.
Print the values 8 9 10 11
Print the sum of N, i.e. 22
The user can save the workspace with all values and programs. In any case, the programs are not compiledA compiled language is a vague term referring to a language whose implementations are typically compilers (translators which generate machine code from source code), and not interpreters (step-by-step executors of source code, where no translation takes p but interpretedIn computer programming, an interpreted language is a programming language whose programs may be executed from source form, by an interpreter. Any language may, in theory, be compiled or interpreted; therefore, this designation refers to languages' implem.
APL is notorious for its use of a set of non- ASCIIASCII A merican S tandard C ode for I nformation I nterchange , generally pronounced 'aski', is a character set and a character encoding based on the Roman alphabet as used in modern English and other Western European languages. It is most commonly used b symbols that are an extension of traditional arithmetic and algebraic notation. These cryptic symbols, some have joked, make it possible to construct an entire air traffic controlSchiphol Airport The air traffic control system gives guidance to aircraft, to prevent collisions and manage efficient traffic flow. See also air traffic controller. Air traffic control can be divided into two major subspecialties, terminal control and en system in two lines of code. Indeed, in some versions of APL, it is theoretically possible to express any computable function in one expression, that is in one line of code. You can use the other line for I/O, or constructing a GUI. Because of its condensed nature and non-standard characters, APL has sometimes been termed a " write-only languageA write-only language is a programming language with the attribute that programs written in it are more easily scrapped and re-written than modified''. Far from being a disadvantage, this tends to avoid the kluge one often gets with modified code. APL and", and reading an APL program can feel like decoding an alien tongue, except to mathematicians, who find more prolix languages much harder to understand. Because of the unusual character set, many programmers used special APL keyboards in the production of APL code. Nowadays there are various ways to write APL code using only ASCII characters.
Iverson designed a successor to APL called J which uses ASCII "natively". So far there is a sole single source of J implementations: http://www.jsoftware.com/ Other programming languages offer functionality similar to APL. A+ is an open source programming language with many commands identical to APL.
Here's how you would write a program that would sort a word list stored in vector X according to word length:
X[X+.¬' ';]Here's a program that finds all prime numbers from 1 to R:
Here's how to read it, from right to left:
Here's the equivalent in Perl:
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++'