> "Dean Theophilou" <[EMAIL PROTECTED]> said:

>       Technically, Perl is NOT an interpreted language.  The Perl interpreter
> converts the program into byte code before executing, just like C.  This is
> a paraphrase of p. 31 of Perl in a Nutshell, by O'Reilly.  I suggest you get
> the book, since it was written by real-world (as opposed to "teachers")
> professional programmers.

A C compiler generates machine specific assembly code which is loaded to 
create an executable program which can run independent of the compiler. e.g. 
the language parsing, code generation step is performed once.  Perl parses and 
generates code each time the program is run.  So parsing and code generation 
overhead is part of normal perl execution.  That is why a perl "executable" is 
just the script itself.

There are ways to generate perl "object" code, but for most application
the reduction in overhead is hardly worthwhile.  Also having the perl
parser and code generator around at runtime is useful for executing
dynamically generated code e.g. eval() and do(). It also allows very
late symbol table binding, since the symbol table is carried with the
execution environment in perl.  This is generally not true with C,
where variables are bound at compile/load time.

Please remember the compile->load->execute paradigm was developed at a
time when memory and cpu cycles were a scarce resource. It works well
when you have to run a program many times (e.g. a heavily used utility
like the Unix shell) with little runtime overhead.


-- 
Smoot Carl-Mitchell
Consultant


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to