NOTICE: Citizendium is still being set up on its newer server, treat as a beta for now; please see here for more.
Citizendium - a community developing a quality comprehensive compendium of knowledge, online and free. Click here to join and contribute—free
CZ thanks our previous donors. Donate here. Treasurer's Financial Report -- Thanks to our content contributors. --

A Programming Language

From Citizendium, the Citizens' Compendium
(Redirected from APL)
Jump to: navigation, search
This article is a stub and thus not approved.
Main Article
Talk
Related Articles  [?]
Bibliography  [?]
External Links  [?]
Citable Version  [?]
 
This editable Main Article is under development and not meant to be cited; by editing it you can help to improve it towards a future approved, citable version. These unapproved articles are subject to a disclaimer.

A Programming Languge (APL), invented by Ken Iverson, is a language influenced by mathematics in general and by arrays and vector mathematics in particular and is somewhat functional. As a vector/array oriented language, it also had elements of parallel programming implicit in its syntax. APL was quite odd looking because it used many non-keyboard characters borrowed from mathematics, these characters were repurposed for programming operations. The oddity of its character set kept it from ever being very popular in practical circles. It is a very terse language and inspired its successor, the J programming language, which is type of ASCII version of APL. To this day, APL and J still code the shortest versions of many algorithms (MDL,Miniumum Description Length theory). Readability is another issue.

History

APL was an influential programming language used to psudo-code papers for industry and research in the 1960's and 1970's. For Iverson at Harvard, APL started out as a compact pseudocode only on paper for computer scientists to teach and communicate (1962). It was made flesh later,(1967) on an actual machine, hence its strange character set. It was commonly joked that APL looked like a language for Martians.


The following expression finds all prime numbers from 1 to R. In both time and space, the calculation is O(R²). -From Wikipedia

(∼R∈R°.×R)/R←1↓ιR


Which is still shorter than a Haskell program using a list comprehension, 40 years later.

 primes :: [Integer]
 primes = sieve [2..]
   where sieve (p:xs) = p : sieve [x | x<-xs, x `mod` p /= 0]