|• Calling functions in an external program from within Mathematica.|
|• Calling Mathematica from within an external program.|
|• Setting up alternative front ends to Mathematica.|
|• Exchanging data between Mathematica and external programs.|
|• Exchanging data between concurrent Mathematica processes.|
MathLink provides a general interface for external programs to communicate with Mathematica. Many standard software systems now have MathLink compatibility either built in or available in add-on modules.
|• Implementing inner loops in a low-level language.|
|• Handling large volumes of data external to Mathematica.|
|• Sending Mathematica graphics or other data for special processing.|
|• Connecting to a system with an existing user interface.|
MathLink-compatible programs range from very simple to very complex. A minimal MathLink-compatible program is just a few lines long. But it is also possible to build very large and sophisticated MathLink-compatible programs. Indeed, the Mathematica notebook front end is one example of a sophisticated MathLink-compatible program.
Much of the power of MathLink comes from its use of Mathematica expressions. The basic idea is that MathLink provides a way to exchange Mathematica expressions between programs, and such expressions can represent absolutely any kind of data.
|• An array of numbers.|
|• A collection of geometrical objects.|
|• A sequence of commands.|
|• A stream of text.|
|• Records in a database.|
|• The cells of a Mathematica notebook.|
The MathLink Developer Kit provides utilities for incorporating these routines into external programs. Utilities are included for a variety of languages, although here we discuss mainly the case of C.