Philosophical musings: interpreters vs. compilers

Paul Dufresne
Sat, 04 Sep 1999 19:42:28 -0400

On Sat, Sep 04, 1999 at 03:40:47PM -0600, Jim Little wrote:
> This is part one.  It may be read independently of part two.
> This email is an unpolished continuation of the thoughts I published in
> "The Will and the Word: A Philosophy of Programming"
Welcome back!

I have some problems with your vocabulary. And it has ever make it
difficult to follows your ideas. I think you will not like the fact
that I can't follow your vocabulary since the time you try to make
it clear, but since you seems to make it back to square one, let
me take the occasion to step in and ask clarifications.

> . Programs are abstract concepts.  They are a wish that the world behave
> in a certain way.
I call that program specification.

> . Programs are reified as models.  A given program may be expressed by
> several different models.
I think what you call models, I simply call programs.

> . Metamodels are used to understand which program a model describes. 
> Metamodels describe a set of models and the corresponding programs.
Is a metamodel a programming language?

My translations seems to fit with the usage you do, but then you
should not be surprised to have some problems to communicate your
ideas if you invent new words for concepts that have already well
known words.

Now about compilers and interpreters. The way I see it, compilers
and interpreters are programs. As such, they have program
specifications which is for the interpreter, to take a program
written in programming language X and execute it, and for the
compiler to take the same input as the interpreter, but generate
code for a programming language Z that is supposed to be a
programming language of lower or equal level to the programming
language Y in which the interpreter or compiler is written.

So if the interpreter is interpreted, it is using the Y interpreter
to execute it's input program and if the interpreter is
compiled, it then use the generated code of Y compiler to execute
it's input program.

On the other hand, the compiler don't use the execution power
given by Y to execute the Z program, but have to translate it to Z,
and will be executed by a Z compiler or interpreter.
If Z is assembler, the Z interpreter will be a machine with a
Z CPU interpreter.

Paul Dufresne