Scripting vs. whatever, again (was Re: Long Live Python!)

Nick Efford nde at comp.leeds.ac.uk
Fri Jul 13 08:50:41 EDT 2001


On Thu, 12 Jul 2001 21:57:26 -0400, Peter Hansen <peter at engcorp.com> wrote:

> > From The Free On-line Dictionary of Computing (06 Jun 01) [foldoc]:
> > 
> >   scripting language
> > 
> >      <language> (Or "glue language") A loose term for any language
> >      that is {weakly typed} or {untyped} and has little or no
> >      provision for complex {data structures}.  A program in a
> >      scripting language (a "{script}") is often {interpreted} (but
> >      see {Ousterhout's dichotomy}).
> 
> Surely by far the most common connotation of "scripting" is in 
> the sense of executing the source directly without the need
> for a separate compilation step. 

That's probably how it is perceived - but to my mind "provision
for complex data structures" is perhaps the most important point,
and is how I distinguish between script and program.  To me, a
script is something that

 * _Appears_ to execute directly, as far as the user is concerned
   (whether there is an implicit compilation step is irrelevant)

 * Relies on external components for data processing and focuses
   instead on providing ways of plugging those components together
   and scheduling their execution

The latter point is not true of Python, which has sophisticated
ways of representing and manipulating state.  So Python code
is a program, not a script.

By this definition, a script might be smaller / easier to write
than a program or vice versa - depending on the nature of the
task undertaken.  I often find a pipeline of the standard
tools like grep, sort, etc, can be constructed on the command
line much more easily than the equivalent Python program;
on the other hand, I can't remember the last time I wrote a
shell script longer than 3 lines - largely because it now seems
so much easier to write anything more 'complex' than that
in Python.

This is on Linux, of course.  When I use Windows, the sheer
impossibility of writing any kind of non-trivial .bat file means
I go straight for Python even sooner.


Nick




More information about the Python-list mailing list