Windows Scripting Languages

Alex Angelopoulos (aka at mvps dot org)

Language certainly makes a difference; but any language can be written well.
 - Robert Martin

There are literally thousands of computing "languages" out there in the real world - and many have some relevance to scripting on Windows.


What's a Scripting Language?

This is fuzzy question, including two terms which are derived from non-computing fields and thus used in a fuzzy sense by many people: scripting and language.

Even the simple word language can be easily mis-applied; software engineers will use the word freely, but the better ones will define it carefully before use - and often do so in different ways.  For most people, the word language carries a lot of mental baggage from social use.  The word is a useful one because the model of human languages can be successfully applied to computing languages, and many of our linguistic skills can be reused in learning computing `languages'.

This can produce some interesting contradictions though; for example, VBScript, VB, and VBA are in terms of grammar and end-use semantics essentially the same language; in fact, you can write an entire module which can be used in any of them, since VBScript is in some ways similar to a simplified single-parent pidgin (to attempt a comparison to real linguistic categories).

I tend to favor a very simplistic description which focuses on usability for a type of task: that task is automating or gluing together large preconstructed parts to accomplish a task.  A script can respond to changing conditions, unlike a macro; but it doesn't concern itself with the minutiae of how an application works, assuming that it can handle details itself.

In this sense, the concept of scripting works pretty well if you think of a script as a theatrical script.  Although the description is complete, the details of implementation are left up to the actual actors and director.

Unfortunately, this does nothing to narrow down the definition of scripting languages: by manipulating applications, any low-level language can be used as a scripting language! (Whether it does so easily may be another story).

Our main focus here will be a specific family of languages, those which are implemented using Microsoft's Active Scripting interfaces, but not exclusively.  Interestingly enough, even the non-Active Scripting languages which implement COM interfaces are easy to pick up for some scripters; the reason is that the daily `vocabulary' of Windows scripting involves dealing with particular COM objects.  To stretch our analogy to the limit,  even with a different language we are still using the same actors.


Active Host Engines

ForthScript

Skeletal implementation of Forth by Mark Hammond. Note that this is most useful as a core for working with Active Scripting implementation; this is most appropriately described as a minimal "Forth-like" language.

Source download from Mark Baker's site:

http://www.mindspring.com/~mark_baker/forthscript.zip

compiled version from my site:

http://dev.remotenetworktechnology.com/files/forth.zip

HaskellScript

Haskell is one of the best-known "functional programming" languages.

http://www.haskell.org/haskellscript/

Jscript

Available from Microsoft; comes with any WSH or Internet Explorer install.

LuaScript

Lua is designed as a lightweight, portable scripting language to be used embedded or on its own.

http://www.luascript.thersgb.net/luascript/

http://lua-users.org

http://www.lua.org/

NullScript

As Hugh Brown, the author, puts it, this is "the scripting language about nothing". It actually serves two useful purposes. It was designed to look at what an active host "says" to a scripting language. The source code itself is a minimalist implementation of the framework for an Active Scripting language.

http://www.iwebthereforeiam.com/projects/NullScript.asp

PerlScript

included with ActiveState's full Perl install.

http://www.activestate.com

Python

included with the full Python install from ActiveState. ActiveState's implementation may be diverging a bit from the Python community's version, though, and the Python community is the best primary source of information.

http://www.activestate.com

http://www.python.org/

comp.lang.python

RubyScript

RubyScript is the Active Scripting version of Ruby, arguably the hottest scripting language in Japan. It has a syntax which will be comfortable for VBScript users, and is seeing heavy use in Europe and the Americas. NASA has begun using Ruby recently for scripting numerically intense applications.

http://arton.hp.infoseek.co.jp/

http://www.ruby-lang.org/en/

http://www.geocities.co.jp/SiliconValley-PaloAlto/9251/ruby/main.html

FYI, most of the reference documentation on the Ruby pages comes from users who are native Japanese speakers and have laboriously translated the information into English. The mix of European and Japanese characters and usage may initially be a little off-putting, but don't let that bother you; if you use Ruby for a while you will begin to see Japanese characters on a page as a sign of elegance and quality. There is full, well-written English documentation here - this is the full text of the book "Programming Ruby":

http://www.rubycentral.com/book

TclScript

http://tclscript.sourceforge.net/

This is a minimalist implementation which is dependent on having a full Tcl installed.

VBScript

Available from Microsoft; comes with any WSH or Internet Explorer install.

Known Commercial Packages

ObjectRexx (IBM)

IBM's Rexx, with support for use natively and as an Active Scripting language.

http://www-4.ibm.com/software/ad/obj-rexx/

Pricing as of January 2003 varies depending on version (US$68-285). A trial version can be downloaded.

Examples of use are somewhat limited in IBM's distribution, but

http://pragmaticlee.safedataisp.net/

PScript (MKS)

Part of the MKS Toolkit; described as a "perl-based web page scripting language".

http://www.mkssoftware.com

ActiveBatch (Advanced Systems Concepts - WinBatch)

http://www.advsyscon.com/

Details of how it works with Active Scripting hosts are unknown to me.


WSH-Like Scripting

I use "WSH-like" scripting to refer to systems which implement simple COM object access but are self-hosting.  These provide interesting avenues for scripters who are used to COM-focused scripting such as that done in WSH to easily exploit current knowledge while moving to another environment.  The following languages implement some form of this via COM access.

Perl

Python

Prolog

ActiveX Extensions for SWI Prolog

Visual Prolog provides an unsupported patch for Creating and Using COM/ActiveX Components with Visual Prolog

Scheme

XLispStat


Comparisons

Some interesting cross-comparisons of programming/scripting languages...

The most interesting one is of course  the parable of the languages.

Jason Voegele's Programming Language Comparison

Timing Trials, or, the Trials of Timing: Experiments with Scripting and User-Interface Languages

A performance comparison done by Brian W. Kernighan (yes, the father of C) and Christopher J. Van Wyk.  Although aging, this is still a fairly good comparison, not because of the data but because of the approach.

David W. Jeske's ScriptPerf Comparison


.NET Scripting and Programming

C#

JScript.NET

VB.NET

Managed C++

MSIL

The Non-VS.NET Compilers

Brainf*ck

Cobol

Fortran

Haskell

Oz

 


The Big Kahunas - Perl and Python


Shell Games

Cmd and Command.com

4NT

Interpretive Shells

Cygwin - sh, csh, bsh, bash, ksh...


Programming Languages

In the listings below, the section headings are usually links to a home page for the language.  Script-specific links may follow.

ANSI C

Brainf*ck

A simple (8 commands) programming language originally developed for the Amiga by Urban Müller.  It has been shown to be Turing-complete.  There is even a .NET compiler for it.

C++

C#

Caml

Cobol

CobolScript

Delphi

Dylan

Functional Objects makes the only Windows version of Dylan I know of; their basic package is free to download.

Eiffel

elastiC

A portable high-level object-oriented interpreted language with a C like syntax.

Erlang

Erlang is a general-purpose programming language and runtime environment. Erlang has built-in support for concurrency, distribution and fault tolerance.

Euphoria

Expect

Forth

Fortran

A decent general resource on Fortran, as well as the home of "F".

ICI

A C scripting language.

Icon

A high-level, general-purpose programming language with a large repertoire of features for processing data structures and character strings. Icon is an imperative, procedural language with a syntax reminiscent of C and Pascal, but with semantics at a much higher level.

Java

Lisp

There are a lot of Lisps, so many that this could be generically called a family if there were not still languages using the specific name "Lisp"; as such, the header links to Google's page on Lisps.

Mercury

Mondrian

Mozart

Parrot

Pike

Pike is a fairly fast interpreted language which has a C/Java-like syntax.

Rebol

Sather

Scheme

Smalltalk (Dolphin)

Steve Waring touched on consuming scriptable COM objects from Smalltalk in his Scriptable Shell Objects in Dolphin Smalltalk page.

F#


Engineering Languages

This is a somewhat esoteric category, exemplified by Octave, Maxima, SciLab, Yorick, Gauss, MatLab, Mathematica, and MathCAD.  Some languages actually fit this category when enhanced via special packages - a case could be made for Python-with-NumPy, for example.

Gauss

Maxima

Octave

Q

SciLab

Yorick