A+

Appeared in:
1988
Influenced by:
Influenced:
Paradigm:
Typing discipline:
Versions and implementations (Collapse all | Expand all):
Programming language

A+ is an array programming language, an immediate descendant of A which in turn was created as a replacement for APL.

A+ was created in Morgan Stanley by a team of developers led by Arthur Whitney. In 1988 Whitney developed A language; it was meant to be a business-oriented version of APL, capable of running on SunOS (platform for distributed calculations) and of handling large arrays of data efficiently. Later other developers extended the language by adding graphical user interface with automated synchronization of variables and corresponding widgets (a widget is a means of displaying a variable) and other features. In 1992 the new language was officially named A+ (+ honored the main improvement over A, the GUI).

Language features:

  • A+ inherited APL’s special charset, so writing programs in it is associated with the same problems. The main IDE for A+ is XEmacs with installed extension and kapl font. The language provides a keyboard layout which shows the mapping of special characters to the keys.
  • A+ program consists of functions definitions, assignment commands and function calls.
  • Unlike APL, the commands are separated explicitly by a semicolon, and thus a command can spawn across multiple lines.
  • A function can accept up to 9 arguments; binary functions can be called using infix syntax instead of the typical prefix one.
  • Primitive functions come in one of three types. Scalar functions are applied to each element of the array independently, though the syntax allows to write this as applying the function to the whole array; examples of such functions are arithmetic and logic functions and some math ones. Structural functions can be defined in terms of array indices; they rearrange the elements or select them but don’t modify them. Finally, the specialized functions modify the array as a whole, for example, matrix inverse.
  • Mapped files are files represented as arrays. Physically only the referenced parts of the files are loaded into memory, so this mechanism allows to process large files.
  • Dependencies mechanism allows to establish a relation between certain variables and recalculate all of them once one variable changes. In particular, this allows to implement a spreadsheet easily.
  • Callbacks mechanism allows to process asynchronous events by triggering associated functions automatically.
  • Contexts enable avoiding naming conflicts by allowing each package to have their own namespace.

Nowadays A+ is an open-source language, though not in active use any more.

Elements of syntax:

Inline comments
Variable identifier regexp [a-zA-Z][_a-zA-Z0-9]*
Variable assignment varname ← value
Block { ... }
Function definition f{arg1; ...; argN} : fBody
Function call f{arg1; ...; argN}
Sequence ;

A+ logo
A+ logo

A+ keyboard layout
A+ keyboard layout

Examples:

Hello, World!:

Example for versions A+ 4.18

String literals can be enclosed both in single quotes and in double quotes.

"Hello, World!"
'Hello, World!'