Advantages of IP Scripting

The benefits of using interprocess communications instead of an embedded language aren't all obvious. In fact, the only obvious advantage is that the user can use any language which has access to the interprocess communications facilities that the application uses. The user is not restricted to the language the application developer liked best, or a language that evolved from a simple macro facility. In particular, if the problem being solved requires parts that are computationally expensive, a compiled language can be used in place of an interpreted scripting language.

Another benefit is the ability to do concurrent processing. Since the application and the script are running on different processes, they can work in parallel if the interface has primitives that return before an operation completes, or the language has concurrent processing support. Since the language can be chosen by the user, finding one with some form of concurrent processing support should always be possible.

As previously mentioned, sometimes an application is given scripting extensions by embedding the application in the scripting language instead of embedding a scripting language in the application. This allows scripts which control the application to be launched from other applications. The same effect can be achieved with an interprocess scripting facility if the application makes the facility public, instead of restricting it to scripts which the application launched. This simple change makes the application a server, allowing the application to be invoked by calendar programs and similar things. It also turns the scripting language into an application integration language, as multiple applications can be used from one script.

Going back to the example of the word processor with the built-in dictionary, it would be nice to be able to use that from other applications. For instance, looking up words on a web page. This is something that can be done in a select/copy/paste manner as previously described. If the scripting language uses interprocess communications facilities and the dictionary is a server, then a script started from the web browser could have the dictionary open a window to display the definition of the word. With an imbedded scripting language, the script must launch a new copy of the dictionary for every word.

Given the above evidence, I believe that using system interprocess communications facilities is the best solution. Yes, it costs a bit for each script, just like using a full scripting language instead of macro language costs a bit more. However, in both cases that small extra cost adds extra power and ease of use which outweighs that cost.

On to Unix interprocess scripting up to the contents, or back to Communications.

Comments