I do not ask you to respect that the processor is a physical black box whereas interpreter implementation is not that clear. As CS, you must look at the functionality aspect -- both processor (physical machine?) and interpreter (virtual machine?) execute a program (a stream of commands).

Isn't to interpret the code just means to evaluate/to execute/to process it?

There is a long article on interpretation in Wikipedia. It uses a lot of words to explain what is interpretation and it even says that it is execution of instruction stream. But nobody stood up and stated that it is just what the processor does (like the child in the "Emperor new clothes")! Why should we think that these are two different things? Processors even invented JIT-compilation (called microcoding) earlier than virtual machines.

Also, bytecode interpretation should give additional clue. It looks like machine code absolutely (to be executed by virtual machines). So, are interpreters just virtual processors?

The self-checking questions are:

  1. What if vendor of your favorite processor discloses you a terrible secret that your instructions are not executed directly but converted into a true machine language beneath, before submitted to the real processor, is you language interpreted or machine?
  2. What if instruction stream for a real processor is executed by emulator (virtual machine) then is it executed by the processor or interpreted?
  3. Can the processor that executes an interpreted language (bytecode or script) is not a processor anymore but an interpreter?
  • 2
    $\begingroup$ The term "interpreter" usually refers to software & "processor" usually refers to hardware but yes, they're doing pretty much the same job. Your first two self-checking questions do happen in real life -- e.g. most x86 CPUs translate x86 code to RISC micro-ops before executing them and you can happily view virtual machines/emulators as machine code interpreters. $\endgroup$ – Matt Lewis Jan 6 '13 at 14:14
  • 3
    $\begingroup$ What is the purpose of this question, other than to split hairs? $\endgroup$ – Andrej Bauer Jan 6 '13 at 21:29
  • 2
    $\begingroup$ We talked about this in a programming language class I oncetook. From one perspective, a chip is just a very special interpreter. Compilation is then a combination of translation (converting the code from one intermediate form to another) and interpretation (actually executing the translated code). $\endgroup$ – jmite Jan 7 '13 at 5:49

Usually, an interpreter is defined in computing terms: it executes instructions by issuing instructions to some lower level of processing. A processor is defined in physical terms: it executes instructions in electronic circuits. It's an interpreter if its behavior is ultimately defined by computer scientists, and a processor if its behavior is ultimately defined by physicists.

There's an exception: if the interpreter is defined in terms of emulating something that would normally be a physical processor, it's called a processor.

But it's only a matter of terminology. There's no profound distinction here. Just go with the flow.

  1. Mu. It's an interpreted machine language. Many processors work that way anyway (where do you draw the line between instruction decoding and interpretation? why would you want to draw a line?).
  2. Mu. It's a processor, and the processor is interpreted.
  3. Mu. If you posit that the language is interpreted then by definition it's interpreted by an interpreter. The interpreter may be a processor.
  • $\begingroup$ Mu = both? Why neither? $\endgroup$ – Val Jan 7 '13 at 17:40

No. Inside my Mac there is a processor, not an interpreter. ZX Spectrum came with a Basic interpreter built in, not a Basic processor.

What is the point of this question?

  • $\begingroup$ What is a point of giving definitions? $\endgroup$ – Val Jan 7 '13 at 10:01
  • 2
    $\begingroup$ But you are not giving definitions, you are discussing how people understand two English words, as used in computer science. While "interpreter" and "processor" could be given narrow technical meanings, and in certain precise contexts it is a good idea to do so (for example, in a textbook on programming languages or a textbook on hardware architecture), discussing "What is an interpreter?" and "What is a processor?" the way you do is a bit like discussing "What is a chair?" $\endgroup$ – Andrej Bauer Jan 7 '13 at 14:13
  • $\begingroup$ I am asking for definitions. What is wrong with asking the chair definition? $\endgroup$ – Val Jan 7 '13 at 17:20
  • 1
    $\begingroup$ You cannot define "chair" in the sense that you are asking for it. This is not a precise enough concept to be defined "mathematically" or "scientifically". Likewise, some scientific terms are better left somewhat undefined, because trying to define them in some narrow sense makes no sense. For example, the notion of "processor" evolves with time, as we develop new kinds of hardware. It is impossible to tell what people will call "processor" 20 years from now. The observation that there is a connection between "interpreter" and "processor" is nice, but that's all it is. A useful observation. $\endgroup$ – Andrej Bauer Jan 7 '13 at 18:35
  • $\begingroup$ This applies to every term and every field. Every notion evolves with time. Why do people invent enciclopedias? This is what you ask. You tell that it is stupid to do and it is stupid to identify things that initially were considered different. I ask because I think otherwise. $\endgroup$ – Val Jan 8 '13 at 19:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.