Why do we call python a scripting language?

John Max Skaller skaller at maxtal.com.au
Fri Aug 27 22:55:13 EDT 1999


On Fri, 27 Aug 1999 10:18:55 GMT, guy_oliver at yahoo.com wrote:

>Why do we call python a scripting language?  
>
>For me, and for most of the people I try to tell about the benefits of
>python, the title 'scripting language' implies that its not a real
>language capable of real programs.  It implies to most of them that it
>is good for simple sysadmin and maybe short cgi scripts.

	Thats right, IMHO. Python (currently) lacks the facilities
required for system programming and programming in the large.

	First, it is not nearly fast enough. For example, my interscript
program is a literate programming tool written in python using
itself. Building interscript, using five or six passes, on my
120MHz Pentium running Linux takes several HOURS.
Using other literate programming tools written in C,
the build would be several SECONDS. Python is
hundreds of times too slow for interscript to be practical
for medium sized projects.

	Second, it lacks the data and control structures,
required for serious programming: they can be implemented,
but the implementations are clunky rather than slick.

	Third, there is very little static type checking,
which not only means python is error prone, and hard to
validate, compared to a language with a statically enforced
type system, but it also makes it hard to optimise

	There are related insecurities, such as the lack
of encapsulation. All these things make Python admirably
suitable for rapid prototyping and small programs,
but not nearly so well suited to building larger systems.

	I will hasten to add that quite a bit can be done
to overcome these problems while preserving many of the
nice features of python. For example, I'm working on a compiler
for Python which will do some static type checking by using
type inference. It is also possible to add new features
'in the spirit of python' which can enhance the facilities available
and make it more suitable for larger projects, both in terms
of efficiency and compile time error detection.

>I usually simply call it an interpreted object oriented programming
>language, as this does not carry with it the implication that its not
>a real language that cant do anything.  

	Python is a real language.

>I usually see people grouping languages into the compiled languages,
>such as c, c++, java, ada, etc, as being the only languages viable for
>large projects, important projects.  Python, perl, tcl, and others are
>grouped into the section of scripting languages for web sites, etc.
>This is not the case, is it?  

	Yes, usually, it is. There will be exceptions, where
performance is less of an issue, or where the requirements
are dynamic enough that the lack of compile time type
checking is outweighed by the need to check things at 
run time _anyhow_.

	Just look at an old version of Grail:
the performance is woeful, and it crashes so often
as to be unusable. Writing a 'modern' browser 
entirely in python (without a compiler) would be silly.
On the other hand, using Python to HOST 
the browser components, written in C, is eminently
sensible: top level architectures are well supported
by flexible dynamic systems like python, because it
makes reconfiguration, extension, etc, easy,
and fairly independent of the lower level, high
performance, components.

>Many of the programs I had tried to write before I
>knew python for my academic pursuits never got finished because I got
>tired of fighting with what ever language I was working with at the
>time.  

	Yes. And this is the status of interscript, because it
is getting too large for Python to handle. (quite apart from
the slow execution times).

	The moral is that you were fighting the language because
your application didn't suit the language.

>Since learning python, I have been able to write most of these
>programs that I never had the time to finish before in a single
>sitting.  Surely that makes python worthy of being thought of as a
>real, viable solution to just about any problem you choose?

	NO! you would be silly to try to implement an
operating system or compiler in Python, for example.
It makes Python a viable solution ... to those problems
for which Python is well suited. <grin>

>Are we doing Python and ourselves a disservice by calling python a
>scripting language?

	No. Python is a 'scripting' language, as opposed to
a systems programming language. It is good at small problems,
and it is good at gluing pieces of other stuff together quickly.

	Python is better (IMHO) at a larger scale of problem than
some other scripting language because:

	a) it has a nice syntax that is easy to work with

	b) it is built on a few simple concepts, so it is 
relatively easy to _reason_ about parts of a program
without having to hold all the code in your brain at once.
These concepts include things like a strong object basis,
the fact that assignments bind local variables only,
and the existence of packaging constructions like
classes, modules, packages, dictionaries, etc.

John Max Skaller                ph:61-2-96600850              
mailto:skaller at maxtal.com.au       10/1 Toxteth Rd 
http://www.maxtal.com.au/~skaller  Glebe 2037 NSW AUSTRALIA




More information about the Python-list mailing list