Program, Application, and Software

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Nov 19 01:07:05 CET 2010


On Thu, 18 Nov 2010 14:21:47 +0000, Martin Gregorie wrote:

> I use 'script' to refer to programs written in languages that don't have
> a separate compile phase which must be run before the program can be
> executed. IOW Python and Perl programs are scripts aloing with programs
> written as awk, Javascript and bash scripts.


You're mistaken then about Python, because it does have a separate 
compilation phase that runs before the program can be executed. Where do 
you think the .pyc files come from, and what did you think the compile() 
function did? It just happens automatically, rather than manually.

For that matter, what about languages with JIT compilers, like Java or, 
yes, Python? CPython itself has no built-in JIT, but PyPy does, and Psyco 
is an optimizing JIT compiler for CPython on some hardware.

I think the difference between "scripts" and "programs" is about as 
meaningful as the difference between "mountains" and "hills" -- there 
clearly is a difference between *this specific* hill and *that specific* 
mountain, but any general distinction between hills and mountains is 
arbitrary and artificial.

Maybe, once upon a time, there was a meaningful distinction to be made 
between purely interpreted languages and purely compiled languages. But 
today, when "interpreted" languages have a compilation phase, and 
"compiled" languages have the equivalent of eval() and do their 
compilation at runtime, such a distinction is now fairly arbitrary. 
Better questions are:

* Does the program compile to native machine code or byte code?

* How efficient is the machine code, or the virtual machine that executes 
the byte code? What do you mean by "efficient"?

* Is there an integrated parse-compile-execute cycle, or does the 
developer have to perform them individually?

* To what degree is the syntax of the language aimed at rapid development 
and/or runtime efficiency?


Harder questions to ask, and answer, than "Is that language for writing 
scripts or programs or applications?", but the answers are far more 
meaningful.



-- 
Steven



More information about the Python-list mailing list