Re: Q: Definition of a scripting lang.

macrakis@osf.org (Stavros Macrakis)
Fri, 10 Mar 1995 19:34:50 GMT

          From comp.compilers

Related articles
Q: Definition of a scripting lang. ariel@ccs.neu.edu (1995-03-04)
Re: Q: Definition of a scripting lang. macrakis@osf.org (1995-03-10)
Re: Q: Definition of a scripting lang. eifrig@beanworld.cs.jhu.edu (1995-03-15)
Re: Q: Definition of a scripting lang. lwall@netlabs.com (1995-03-27)
Re: Q: Definition of a scripting lang. rpereda@wotangate.sc.ti.com (1995-04-05)
Re: Q: Definition of a scripting lang. lwall@netlabs.com (1995-04-16)
Re: Q: Definition of a scripting lang. leichter@zodiac.rutgers.edu (1995-04-18)
| List of all articles for this month |

Newsgroups: comp.compilers
From: macrakis@osf.org (Stavros Macrakis)
Keywords: interpreter, question, comment
Organization: OSF Research Institute
References: 95-03-034
Date: Fri, 10 Mar 1995 19:34:50 GMT

ariel@ccs.neu.edu (Ariel Lieberman) writes:


            I'm looking for a definition of a scripting lang. (Perl, REXX,
            Tcl, etc.) What are the differences between scripting lang. and
            "regular" programming lang. (C, C++, Ada, Smalltalk, etc.)


Our moderator replies:


      A scripting language is one in which people think they're writing
      scripts, and a programming language is one in which they think
      they're writing programs....


Lieberman deserves a less flippant answer. Let me try one.


----------------


Scripting languages support doing programmatically what otherwise is
done directly by the user through direct commands (whether textual or
graphical).


Several characteristics follow from this definition.


Scripting languages often follow the syntax and semantics of command
languages. For instance, many scripting languages do not require
quoting of string literals, but rather require explicit evaluation of
variables (x denotes the string "x", but $x denotes the value of the
variable x).


Scripting languages make it easy to call system commands, prepare
their arguments, and manipulate their results. They generally have
some built-in primitives for manipulating file and directory names,
argument lists, environment variables, etc.


Scripting languages generally are good at handling strings, and don't
emphasize numerical manipulation.


Since calling system commands is generally much more expensive than
script execution itself, there is little emphasis on run-time
efficiency, therefore they are often implemented using interpreters,
bytecode interpreters, or macro processors.


----------------


Some command languages (e.g. Unix sh or csh command languages) are
also useful as scripting languages. Some scripting languages can be
used instead of a command shell. Some programming languages can
easily be used as scripting languages (with appropriate libraries).


In my opinion, it is a bad idea to distinguish sharply between the
design of scripting languages and the design of other programming
languages. What starts out as a small script may develop over time
into a very sophisticated program. Users may wish to share
independently-maintained modules between scripts -- hence a need for
namespace control and clear interface definition. Error handling may
become necessary -- hence a need for exception handling. Cooperation
among asynchronous processes may be necessary -- hence a need for
threads or continuations and their related synchronization mechanisms.
In short, many of the same problems that face programmers in general
face script programmers in particular.


-s
[I suppose one might draw the line by saying that a scripting language is
one where the main effect of a program is to drive another system, while in a
programming language the program itself is the main action. -John]
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.