What Is Active Scripting?

Alex Angelopoulos (aka at mvps dot org)

For years programming and scripting languages have traditionally struggled with a variety of techniques for getting things done, and have suffered from the lack of common infrastructure for tasks which really have nothing to do with language issues at all.  This has been a problem on all operating systems, but we'll be focusing on Windows here.

With scripting in particular this has been a significant issue not only for language users but also developers who may want to implement support for scripting into their applications.

The primary issue has been interfaces to externals.  A language will normally implement all sorts of internal plumbing for manipulating data and making decisions, but this is a separate issue from interfacing with an operating system or a web browser.

When it comes to externals, most of the desired tasks are identical for any language: getting command line arguments and sending output to a console/window/application callback are two examples of this.

The concept of Active Scripting is to define a simple interface which defines how a language connects to the world around it - to a hosting application, in other words.

This is a radical idea in some ways.  Rather than needing to reimplement a scripting language hosted within an application, an application developer can simply define interfaces, making the application into an Active Host; then any language which is implemented as an Active Scripting language can be hosted within it.

This also means that any scripting language developer can implement the basics of a scripting language, and immediately know that it can be used in any host supporting Active Scripting.

This idea is pragmatic and simple, but has demonstrated its revolutionary value in the simplest possible way: it works.  There are flaws in the original structure of Active Scripting, of course, but by and large it has proven itself to be an excellent idea and is a conceptual ancestor of the .NET paradigm.

The well-known hosts for Active Scripting include Windows Scripting Host (two hosts actually, wscript and cscript), Internet Explorer, MSHTA, and the Microsoft Script Control;  there are a large number of other hosts, primarily gaming engines.

The languages supported and freely available beyond Microsoft's own Jscript and VBScript include implementations of the popular Haskell, Lua, Perl, Python, and Ruby; a sketchy Tcl; a Forth-like demo from Mark Hammond of Python fame; and Hugh Brown's interesting tool for examining hosts, NullScript.  Commercial implementations include IBM's ObjectRexx, MKS' Pscript variant of Perl, and ActiveBatch, as well as a number of smaller proprietary systems.  You can find more details on the languages I know of on my Languages page.