On Mon, 2005-05-23 at 15:04 -0700, Ian Puleston wrote:
-----Original Message----- From: fedora-list-bounces@xxxxxxxxxx [mailto:fedora-list- bounces@xxxxxxxxxx] On Behalf Of Jeff Vian
When you write a C program, isn't the source code a "script of commands" telling another program (the compiler), what to do?
yes
Nope, the compiler is simply a translator that translates the program into terms that the computer understands. It's the computer that executes the program, not the compiler.
The same applies to an interpreter. It "interprets" the code (script) and provides the resulting machine understandable commands to the machine.
Not so. It's more accurate to regard the interpreter as implementing a virtual computer. One whose primitives are the instructions of the language.
No, that is a misrepresentation. The interpreter serves a function
similar to the compiler. It makes human readable text into machine
understandable code. (run time compiled instead of precompiled) The
real difference is when the compiling is done, and how.
Some interpreters (bot probably not most) Pascal originally compiled to a form called pcode and then there was a program to interpret the pcode.
Java still does that (aside from the compilers that compile to machine code). Some JVMs implement a "just-in-time" compiler that does create machine instructions, but AFAIK that can be turned off and is optional.
--
Cheers John
-- spambait 1aaaaaaa@xxxxxxxxxxxxxxxxxxxxxxx Z1aaaaaaa@xxxxxxxxxxxxxxxxxxxxxxx Tourist pics http://portgeographe.environmentaldisasters.cds.merseine.nu/