Mathematica
Mathematica is a widely-used computer algebra system originally developed by Stephen Wolfram and sold by his company Wolfram Research. Currently, Mathematica is one of the most widely used commercial symbolic mathematics packages.
| Table of contents |
|
2 The Mathematica language 3 Front ends 4 See also 5 External links |
Wolfram started to work on the program in 1986 and released the first version in 1988. The current version is 5.0. It is available on a wide variety of systems.
At its core lies a Lisp-like programming language implemented in an object-oriented variant of C that can be used to extend the system. The bulk of the extensive library of code is actually written in the form of Mathematica "packages", i.e., text files written in the Mathematica language.
This language is interpreted by a kernel that performs the actual computations. The results are usually communicated to one of several frontends. Communication between the kernel and the frontend (or any other client, like user-written programs) uses the MathLink protocol, often over a network. It is possible for several frontend processes to connect to the same kernel, and for one frontend to be connected to several kernels.
Several other frontends are also available, e.g., JMath or mash, but the standard Mathematica frontend is the most popular.Overview
The Mathematica language
The Mathematica language itself is a term-rewriting system that aims to behave as a functional programming language would, but admits other paradigms to be used, such as procedural programming, albeit typically at a substantial performance penalty for large problems. Other than some other computer algebra systems like, e.g., Maxima or Maple, Mathematica tries to apply the currently stored transformation rules as long as possible, looking for a fixed point. For this to be meaningful, absence of side-effects is beneficial (though not enforced), hence the similarity to functional programming. Functions and code are first-class and not opaque. Scoping is dynamic, but there are also some constructs that try to simulate lexical scope (all of these can easily be broken).Example Mathematica code
The following Mathematica sequence will find the determinant of the 6×6 matrix whose i, j'th entry contains ij with all zero entries replaced as 1.
In[1]:= Det@ReplaceAll[Table[i j, {i,0,5}, {j,0,5}],{0->1}]
Out[1]:= 0So the determinant of such a matrix is 0.Front ends
The Mathematica frontend features extensive layout and graphical capabilities, performs prettyprinting and offers a notebook metaphor - user input (both text and Mathematica input) as well as results sent by the kernel (including graphics and sound) are placed in a hierarchy of cells (as is the case for Maple), which also allows for outlining and sectioning of a document. Starting with version 3.0 of the software, notebooks are represented as expressions that can be manipulated by the kernel, and the typesetting features of the frontend were deemed sufficiently important to warrant the availability of a dedicated reader software for displaying Mathematica notebooks, the MathReader software that is not tied to a commercial license.