What is a scripting language?

The first scripting facilities were just macros, which let the user issue a series of application commands with one command. This is fairly simple to build into an application. For CLI applications, the ability to read commands from a file did the trick. For more graphical applications, capturing the users' keystrokes or mouse clicks to a file sufficed.

These facilities starting getting larger. Macros which automatically stopped if the command failed were followed by macros that set the exit level considered to be failure, checked that level. Special commands that tested the exit level and conditionally executed other commands - including macros - based on it. The ability to pass arguments to commands was followed by the ability to do string manipulation. Add in some more special commands - first to test strings for equality, then to see if they matched regular expressions. At this point, you're clearly writing scripts and not macros. No single such feature makes something a scripting language instead of a macro language, but the combination is clearly a scripting language, albeit primitive.

Beyond scripts are programs. Again, the delineation isn't exact. Scripting languages have added features traditionally associated with programming languages - functions, static scoping, object-oriented facilities and a library of utility objects or functions. The scripting languages are marked by good string-handling primitives, and tend to be interpreted. They also tend to have powerful data structures - arrays that grow dynamically, or hash a string or arbitrary object - as primitive types, whereas "applications" languages have these facilities in libraries. Again, no single feature defines a scripting language. See John Ousterhout's Scripting Paper for more information on this topic.

On to Communications alternatives up to the contents, or back to Why scripting?

Comments