Python & Linux ?

Mark Wyatt tmf002 at email.mot.com
Tue May 22 14:13:33 EDT 2001


I think this has been alluded to by others, but I think you are being a bit
unclear & confused about terminology, as much as anything.

The interpreter vs. compiler thing doesn't matter at all, from this point of
view. Once upon a time, in a land far, far away (when there were only the
Knuth books, and people tried to write serious applications in Cobol and
Fortran) there were only Compilers and Interpreters, and never the twain did
meet. I suppose it was imagined that it would be that way for all time, but
that's not really how it turned out.

Starting at Pascal (oh, I am not sure about that 'starting at', make it
'popularised by'), there came into being hybrid systems that had both
'compile' and 'interpret' stages. To cut a long story short, many modern
languages are like that, and differ mostly in degree. I am pretty sure that
I read some article by a Technical Guru at Microsoft where he was defending
VBAPPS (popularly considered an interpreted language, but having a compile
stage) by saying that, what with time spent in library calls, even in a
worst-case situation a fully compiled language could only be something like
20% faster. And that was in the situation where a compiled language would
show the biggest performance advantage.

This Microsoft Guy (sorry, don't have the article, and memory is not what it
was) went on to say that Compiler or Interpreter is a false opposition. I
hadn't thought of it like that, but it is true. As I said earlier a lot (but
not all) of the Pascal systems of the time compiled source code to p-code,
and interpreted p-code. This, in principle, is the same general scheme as
compiling byte-code and interpreting that, which many modern languages, or
more exactly, modern implementations of languages, do. So they actually have
both.

Now a language like C (or C++) is popularly compiled, and does not have an
interpret stage. The compiler attacks your source and spits out (plus or
minus a linking stage, or so, and a bit of footling around, which doesn't
affect the principles) machine code for the target machine. And that is
'pure' compilation. But you could build a C interpreter, if you really
wanted to.

{Interesting side issue: If you spend a lot of your time in library calls
does it make any difference whether you have a compiled or an interpreted
language? Well, in principle, no, but in practice you may actually be better
with an interpreter with well writtten and robust libraries than a compiler
and having to 'cobble together' your own, less-than-perfectly-tested,
less-than-perfectly-optimised, ones.}

Now, what's a script? In UNIX parlance a script is a simple, or not so
simple, program usually to perform some administrative task, or tasks. So,
probably, if I felt in a nit-picking frame of mind I should complain at many
of those who say they have written 'hello world' programs, that they have
written 'hello world' scripts, particularly if they ran on UNIX systems and
produced their output in a shell rather than in their own little window,
with decorations and buttons to push.

But, if you carry on adding features {complexity, oppotunities for bugs,
bloat} to your script for long enough, it'll become a program. Perhaps, none
the better for it, but that really is off topic.....

So, what are we left with? Installable, as I call it. Well, sure you can
develop installable scripts/programs. As has been commented by others, the
issues there come in terms of protecting intellectual property, of
robustness {what if the target directory doesn't exist, what if there are
different libraries to the ones that I used to develop with?}, etc. Which,
in a nice outbreak of circularity, brings me to mention the concept of an
'Install script' to tidy up the details.

So, really, a lot of your questions are really as much about terminology as
anything else. But you can write installable programs via this route. The
mechanisms may be different from those that you are used to, but you ought
not to worry that it isn't possible.

                                            Mark

Peter Moscatt wrote:

> I have just migrated from Win98 over to Linux.  My programming platform
> under Win98 was VB.
> Now in Linux, I have decided to program using the Python platform.
> I have bought myself a get started book and from what I can gather -
> Python is a Interpreter and not a Compiler, therefore only being able to
> develop scripts instead of installable programs.
>
> Have I got it all wrong here ??
>
> Pete




More information about the Python-list mailing list