Wolfram Symbolic Transfer Protocol
To make an external program's and the Mathematica kernel's instructions understandable to each other, we need a common protocol—and WSTP is such a protocol.
This protocol is used to include certain source code in the body of an external program, and then its internal functions and data structures are available in Mathematica.
In order to run an external program, you should use the Install
function, where a path to the running program is used as a parameter. The Uninstall
function is used in order to end a session with a remote program. For example, let's call one of the demo programs that come with the Mathematica system— the bitops
and bitAnd
functions, which return the conjunction of two integers:
In this example, we have used useful functions such as SetDirectory
and ResetDirectory
that allow us to set the folder to search for programs. Note the $InstallationDirectory
variable—the folder in which Mathematica is installed...