Installing Existing WSTP-Compatible Programs

One of the most common uses of the Wolfram Symbolic Transfer Protocol (WSTP) is to allow you to call functions in an external program from within the Wolfram Language. Once the external program has been set up, all you need to do to be able to use it is to "install" it in your current Wolfram Language session.

Setting up external programs with functions to be called from within the Wolfram Language.

This installs a WSTP-compatible external program called bitprog:

Install["bitprog"]

BitShift is one of the functions inside bitprog:

BitShift[111,3]

You can use it just as you would a function within the Wolfram Language:

Table[BitShift[111,i],{i,3,8}]

When you have a package written in the Wolfram Language, a single version will run unchanged on any computer system. But external programs typically need to be compiled separately for every different type of computer.

The Wolfram System has a convention of keeping versions of external programs in directories that are named after the types of computers on which they will run. And assuming that this convention has been followed, (RefLink[Install, paclet:ref/Install])["prog"] should always install the version of prog appropriate for the particular kind of computer that you are currently using.

Using context names to specify programs to install.

When you ask to read in a Wolfram Language file using <<name`, the Wolfram System will automatically search all directories in the list (RefLink[$Path, paclet:ref/$Path]) in order to find a file with the appropriate name. Similarly, if you use (RefLink[Install, paclet:ref/Install])["name`"], the Wolfram System will automatically search all directories in (RefLink[$Path, paclet:ref/$Path]) in order to find an external program with the name name.exe. (RefLink[Install, paclet:ref/Install])["name`"] allows you to install programs that are stored in a central directory without explicitly having to specify their location.