How WSTP Is Used
The Wolfram Symbolic Transfer Protocol (WSTP) provides a mechanism through which programs can interact with the Wolfram Language.
■ Calling functions in an external program from within the Wolfram Language.
■ Calling the Wolfram System from within an external program.
■ Setting up alternative front ends to the Wolfram Language.
■ Exchanging data between the Wolfram System and external programs.
■ Exchanging data between concurrent Wolfram System processes.
WSTP provides a general interface for external programs to communicate with the Wolfram Language. Many standard software systems now have WSTP compatibility either built in or available in add‐on modules.
In addition, the WSTP Developer Kit bundled with most versions of the Wolfram System provides the tools you need to create your own WSTP‐compatible programs.
Once you have a WSTP‐compatible program, you can transparently establish a link between it and the Wolfram Language.
The link can either be on a single computer or it can be over a network, potentially with a different type of computer at each end.
■ Implementing inner loops in a low‐level language.
■ Handling large volumes of data external to the Wolfram Language.
■ Sending the Wolfram Language graphics or other data for special processing.
■ Connecting to a system with an existing user interface.
WSTP‐compatible programs range from very simple to very complex. A minimal WSTP‐compatible program is just a few lines long. But it is also possible to build very large and sophisticated WSTP‐compatible programs. Indeed, the Wolfram System notebook front end is one example of a sophisticated WSTP‐compatible program.
Much of the power of WSTP comes from its use of Wolfram Language expressions. The basic idea is that WSTP provides a way to exchange Wolfram Language 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 Wolfram System notebook.
The WSTP library consists of a collection of routines that allow external programs to send and receive Wolfram Language expressions using the fundamental C data types.
The WSTP Developer Kit provides utilities for incorporating these routines into external programs. Utilities are included for a variety of languages, although here mainly the case of C is discussed.