A+
Morgan Stanley's array-oriented APL dialect, created by Arthur Whitney in 1988 to move large-scale financial computing off the mainframe and onto Unix workstations.
Created by Arthur Whitney, extended by developers at Morgan Stanley
A+ is an array-oriented programming language created at Morgan Stanley with an APL heritage. It began in 1988 as A, a stripped-down and speed-oriented APL dialect written by Arthur Whitney, and grew into A+ as other Morgan Stanley developers added a graphical user interface, interprocess communication, and a set of language features aimed squarely at large-scale financial computing. A+ is one of the few times a major Wall Street firm took an internal language that ran its business and handed it to the world: in 2001 Morgan Stanley released the interpreter under the GNU General Public License, and the A+ Reference Manual under the GNU Free Documentation License.
Today A+ is dormant - the last upstream release, 4.22-1, dates from March 2008 - but it remains one of the clearest windows into how array programming actually worked in production finance, and into the thinking of the programmer who would go on to create K.
History and Origins
In the late 1980s, Morgan Stanley ran substantial APL applications on IBM mainframes and wanted to move them to a network of Sun Microsystems workstations. Arthur Whitney, who was working at the firm by 1988, wrote a new APL dialect for that migration: a smaller set of primitive functions, an implementation tuned for speed, and a design aimed at handling large sets of time-series data. That language was called A.
A did not stay a one-person project. Over the following years, colleagues at Morgan Stanley refined it with additional language features and an “electric” graphical interface in which variables and on-screen widgets stay automatically synchronized. The extended language became known as A+.
Whitney left Morgan Stanley in 1993 and co-founded Kx Systems with Janet Lustgarten to commercialize K, a further-distilled array language that dropped the APL character set entirely in favor of ASCII. A+ continued to be developed and maintained inside Morgan Stanley without him; the language and its reference manual carry a Morgan Stanley Dean Witter & Co. copyright.
The public release came in 2001. The free software distribution, named aplus-fsf, shipped the interpreter, the screen management and IPC toolkits, an XEmacs-based development environment, the APL fonts, and the complete reference manual. The README in the original distribution is dated January 25, 2001.
Design Philosophy
A+ takes APL’s central bet - that whole-array operations are both more concise and more efficient than element-at-a-time loops - and reorganizes it around the needs of production financial systems. The reference manual is blunt about the trade-off: the A+ language processor is an interpreter, so array thinking is not optional. “Thinking in terms of array algorithms is both a requirement and an opportunity,” it notes, and code that falls back to scalar loops will not perform well.
Three ideas dominate the design:
Data lives in arrays, including data on disk. Files are exposed as mapped files - simple, non-nested arrays backed by the filesystem. Only the referenced parts of a file are brought into memory, so moving a prototype that works on in-memory arrays to a production system that works on very large files requires, in the manual’s words, only minimal code modification.
The screen is an array, too. An array displayed with the show function shares storage with its screen view. Changing the array in the workspace immediately updates the display; editing the display immediately updates the array. There is no separate model-view synchronization layer to write.
Recalculation is declarative. A+ generalizes the spreadsheet to arrays through dependencies (described below), so that derived values stay current automatically without the programmer scheduling the updates.
Key Features
Leading-axis operations
Most A+ structural primitives - Catenate, Take, Drop, Reverse, Rotate, Replicate, and Expand - and functions derived from Reduce and Scan apply to the leading axis of their right argument. They rearrange the items of an array (the subarrays obtained by fixing a single scalar index on the first axis) rather than reaching inside those items. This was a deliberate simplification of APL’s more general axis specification, and it later became a defining trait of K and q.
The rank operator
A+ generalizes leading-axis thinking with the rank operator @. An array is treated as a frame defined by its leading m axes holding cells of rank n defined by its trailing n axes. Writing f@n applies f to every cell of rank n:
| |
The rank operator applies uniformly to primitive, derived, and defined functions of one or two arguments, with the exceptions of Assignment and bracket indexing (though it does apply to Choose, which is semantically equivalent to bracket indexing).
Dependencies
A dependency is a global variable with an associated definition - the spreadsheet cell, generalized. When a dependent variable is referenced, its definition is re-evaluated only if something it references has changed since the last evaluation; otherwise the stored value is returned. Dependencies always see current values like a function would, but avoid recomputation like a cache would.
| |
Crucially, an A+ “cell” is not restricted to a scalar. Any array can be a cell, and the definitions can use the full language, so a dependency can express something as substantial as a relational-database view over source data.
Callbacks
Callbacks are functions automatically invoked in response to changes to variables or to screen events - assigning to a variable, or selecting a row in its display, can trigger one. Together with dependencies, they give A+ a complete story for asynchronous, event-driven applications without an explicit event loop in user code.
Contexts
Contexts are separate namespaces within a single workspace. Utility packages and toolkits get their own private sets of names, and code outside a context refers to those names by qualifying them with the context name - the mechanism that let A+ applications stay modular as they grew.
Syntax
A+ uses the APL character set entered from the APL Union Keyboard, with special characters produced by holding Meta (or Alt) while pressing a key. Beyond the glyphs, the syntax departs from classical APL in several ways. Arrays are indexed from zero, so ⍳3 4 yields a 3×4 matrix populated with the numbers 0 through 11. Function definitions use a colon and an optional brace-delimited expression block, and come in monadic, dyadic, and general forms:
| |
The precedence rules are famously spare: all functions have equal precedence, whether primitive, defined, or derived; all operators have equal precedence; and operators bind more tightly than functions. Bracket indexing takes the form x[a;b;…;c], with empty positions selecting whole axes, and strands - parenthesized, semicolon-separated collections such as (a;b;c) - build aggregates. A+ also adds conventional control statements (case, do, if, if-else, while) on top of the array primitives.
System features
The A+ system ships more than a language:
| Component | Purpose |
|---|---|
| Screen management | Buttons, tables, layouts, and graphs bound directly to arrays |
adap | Interprocess communication between A+ and other processes, based on A+ arrays |
| Mapped files | Disk files accessed as ordinary simple arrays |
| Dynamic linking | C functions loaded at run time and called like defined A+ functions |
| Emacs/XEmacs mode | The application development environment, with function keys to send a line or a whole definition from a script buffer into a live A+ process |
| Scripts | Plain text files of definitions and expressions, loadable and nestable |
The Emacs integration is the canonical A+ workflow: two buffers, one holding the running interpreter in “desk calculator” mode with a session log, the other holding the application source, with keystrokes shuttling code between them.
Evolution
The public release history is short and well documented in the distribution’s own changelog:
| Version | Date | Highlights |
|---|---|---|
| 4.18 | 2001 | Initial free software release as aplus-fsf |
| 4.18-2 through 4.18-8 | 2001 | Rapid bug-fix series through December 2001 |
| 4.20-1 | December 31, 2003 | _memStats system function, configurable msync behaviour for mapped files, GCC 3.3 build fixes, memory-leak and segfault fixes |
| 4.20-2 | August 29, 2005 | Newer GCC compiler fixes; scripts, Lisp, font, and contrib directories added to the tarball |
| 4.22-1 | March 27, 2008 | Extensive 64-bit fixes; adap.SyncConnect |
The 4.20 INSTALL file gives a good picture of the platforms the project actually tested in that era. Its compiler/platform grid lists several Red Hat Linux versions on i386, ia64, s390, and alpha, Yellow Dog Linux 2.1 on PowerPC, Debian, FreeBSD 4.3, NetBSD 1.5.2, IRIX 6.5.12 on MIPS, Solaris 2.7 and 2.8 on SPARC, AIX 5.1, Tru64 5.1 on Alpha, and Mac OS X on PowerPC, built with GCC versions from 2.91.66 through 3.0.3 or the vendor cxx and MipsPro compilers - marking each combination as working or not, so the list is a record of what was tested rather than a blanket support matrix. The build needs X11, and the source tree still carries platform fix-up scripts named fix4aix, fix4mac, fix4netbsd, fix4mipspro, and fix4cxx. That grid reflects what upstream tested in the early 2000s, not what builds cleanly today - and per the project’s own description, the graphical interface was never ported to every supported platform.
Upstream development stopped after 2008. Downstream packaging kept going: Debian has carried aplus-fsf along with development, documentation, and XEmacs Lisp packages, with revisions of 4.22.1 uploaded well into the 2020s across a wide set of architectures.
Current Relevance
A+ is dormant by any reasonable measure. There has been no upstream release since 2008, the project’s home at aplusdev.org is a relic, and the development environment assumes XEmacs and an APL font - a stack that has aged considerably. Anyone starting an array-programming project today would reach for Dyalog APL, GNU APL, J, K/q, or an array library in a mainstream language.
Its relevance is historical and genealogical, and that relevance is real. A+ is the best-documented public artifact of Arthur Whitney’s transition from APL to K. The leading-axis discipline, the aggressive reduction of the primitive set, the obsession with interpreter speed on large time-series data, and the idea that a language should come with its own IPC and screen layers all show up again in K and q, the languages behind kdb+, which is widely used for financial time-series work. Reading the A+ reference manual is reading the design notes for that lineage.
For the APL community, A+ is also a rare complete example of an in-house corporate APL dialect released with its full documentation. Most such systems - and there were many, at banks, insurers, and utilities - vanished when their firms migrated away. A+ survived because Morgan Stanley chose to publish it.
Why It Matters
A+ matters for three reasons.
It shows array programming in production, not in a paper. The features that distinguish A+ from textbook APL - mapped files, dependencies, callbacks, screen-array sharing, adap - are all answers to concrete problems in running a trading and research business: data too big for memory, values that must stay consistent across a web of derived quantities, interfaces that must react to live markets, and processes that must talk to each other in the language’s own data format.
It is a missing link. Between Iverson’s APL and Whitney’s K sits a language that took APL’s notation and began stripping it toward the terse, leading-axis, zero-indexed style that K would carry to its conclusion. A+ is where that transition is visible and readable.
It anticipated reactive programming. Dependencies are spreadsheet semantics generalized to arbitrary arrays and arbitrary computation, complete with change tracking and lazy re-evaluation - shipped in a production financial language decades before the term became fashionable, and describable today as a reactive dataflow system. The vocabulary has changed more than the idea.
Timeline
Notable Uses & Legacy
Morgan Stanley
A+ was created and used inside Morgan Stanley, where it was designed to carry the firm's existing APL applications off IBM mainframes onto networks of Sun workstations. The reference documentation is copyrighted to Morgan Stanley Dean Witter & Co., and the language was used primarily within the company before its public release.
Financial time-series and analytics systems
A+ was explicitly designed around large time-series datasets: mapped files let gigabyte-scale files be treated as ordinary arrays with demand paging, and the adap toolkit connects A+ processes to real-time data managers that read and write A+ arrays.
Interactive trading and research screens
The A+ screen management system binds arrays directly to on-screen widgets so that the workspace array and the screen view share the same storage, with callbacks firing on user actions - a design aimed, according to the reference documentation, at dashboards and analyst-facing tools built on live data.
Debian and other free software distributions
Since the 2001 GPL release, A+ has been packaged as aplus-fsf, with run-time, development, documentation, and XEmacs Lisp packages available in Debian, making an otherwise in-house language installable with a single command.
Array-language history and research
A+ is studied as the documented bridge between classical APL and Arthur Whitney's later work on K and q, preserving in readable, open-source form the design ideas - leading-axis operations, the rank operator, and dependencies - that shaped modern array-language practice.