1
$\begingroup$

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?
$\endgroup$
4
  • 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, 2013 at 14:14
  • 3
    $\begingroup$ What is the purpose of this question, other than to split hairs? $\endgroup$ Jan 6, 2013 at 21:29
  • 3
    $\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$ Jan 7, 2013 at 5:49

2 Answers 2

4
$\begingroup$

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.
$\endgroup$
2
  • $\begingroup$ Mu = both? Why neither? $\endgroup$
    – Val
    Jan 7, 2013 at 17:40
  • $\begingroup$ Interesting examples: 8-bit micros like 6502 or Z80 that effectively did interpret (run a sequence of microinstructions from a table indexed by opcode). Or Transmeta's Crusoe that did dynamic recompilation from x86 to an internal VLIW (not 1-instruction-at-a-time) and cached the results. (@Val). Basically what a JIT-compiling JVM does, but packaged up as an x86 CPU instead of being pure software. $\endgroup$ Sep 22, 2021 at 9:28
1
$\begingroup$

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?

$\endgroup$
7
  • $\begingroup$ What is a point of giving definitions? $\endgroup$
    – Val
    Jan 7, 2013 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$ Jan 7, 2013 at 14:13
  • 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$ Jan 7, 2013 at 18:35
  • 1
    $\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, 2013 at 19:43
  • 1
    $\begingroup$ Besides the reason to define the notions, finding connections between things makes thesaurus stronger and simplifes understanding. It is much easier to say that this thing does the same than explain everything from the scratch. The fact that the question was not welcomed does not make it pointless. This is your manipulation again. $\endgroup$
    – Val
    Jan 9, 2013 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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