Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
33 votes
Accepted

Would it be wrong to say that the processor (and hardware) is the implementation of an interpreter for machine language?

It's not such a bad way of looking at things. On most modern CPUs, the instruction set architecture (ISA for short) is abstract, in the sense that it doesn't dictate that it must be implemented using ...
Pseudonym's user avatar
  • 22.2k
13 votes

Do you ever "download" a language?

A programming language is a formal language, informally speaking a collection of words with a well-formed set of specific rules. As such, you can write down the definition of a formal language and ...
Juho's user avatar
  • 22.6k
9 votes

How can a stack-based VM be Turing-Complete?

If the stack machine is only allowed to access the top of the stack, and apart from the stack it only has a finite amount of storage, then it's a pushdown automaton. Pushdown automata are not Turing-...
Gilles 'SO- stop being evil''s user avatar
8 votes

Would it be wrong to say that the processor (and hardware) is the implementation of an interpreter for machine language?

No, it would not be wrong. Indeed, we can use the Futamura projections to help us understand the situation. The first Futamura projection says that if we specialize hardware with some native machine ...
Corbin's user avatar
  • 230
7 votes
Accepted

Do you ever "download" a language?

A programming language is a formal language. Most likely its context-free, sometimes context-sensitive, rarely just regular (mostly eso-langs, and some assembly languages). There usually exists a ...
Polygnome's user avatar
  • 186
7 votes

Do you ever "download" a language?

You download the language's tools. If the language can be compiled to a "native" executable, (e.g., like "Rust") then you download the compiler, and probably a run-time support library, and maybe a ...
Solomon Slow's user avatar
7 votes
Accepted

Reference request: optimizing procedures on lists in dynamic languages by performing safety checks in advance

I'm not aware of anything exactly like this, but there are some things that are arguably related. For specifically sorting this is related to the Schwartzian transform, though with a very different ...
Derek Elkins left SE's user avatar
7 votes

Would it be wrong to say that the processor (and hardware) is the implementation of an interpreter for machine language?

You could look at it that way. But traditionally, the term "interpreter" is usually used to refer to software, not hardware. There are CPU emulators, these can definitely be considered to be ...
Barmar's user avatar
  • 443
5 votes
Accepted

If Interpreters are used to run code and are written in another language, won't interpreters need interpreters?

If Interpreters are used to run code and are written in another language, won't interpreters need interpreters? Yes. Maybe. But mostly yes. Depending on how you look at it. You need an interpreter to ...
Jörg W Mittag's user avatar
4 votes
Accepted

How can a stack-based VM be Turing-Complete?

You are confusing stack-oriented programming languages (resp. their interpretation model) with pushdown automata. The former can be Turing-complete because they can access an (infinite) random-access ...
Raphael's user avatar
  • 72.5k
4 votes
Accepted

Implementing a Compiler with Macros

Yes and no. Yes, you could structure a compiler this way, but most of the benefits you are hoping for would not materialize. There may be some benefits, such as a powerful compile-time meta-language. ...
Derek Elkins left SE's user avatar
4 votes

Would it be wrong to say that the processor (and hardware) is the implementation of an interpreter for machine language?

You can build any program as a circuit, check e.g. most texts on computability, they often discuss circuit complexity for solving problems in addition to the more traditional Turing machine models (...
vonbrand's user avatar
  • 14k
4 votes
Accepted

What other implementation styles are there besides compilation, interpretation and transpilation?

Fundamentally, there are only the two: compilation and interpretation. tl;dr: An interpreter runs the program, a compiler translates the program to another language. An interpreter for language X is a ...
Jörg W Mittag's user avatar
4 votes

Would it be wrong to say that the processor (and hardware) is the implementation of an interpreter for machine language?

If one can make the analogy, when would it break down? What features of language semantics (given by the interpreter), for example expressions and values, are there that we can't find at the physical ...
pjc50's user avatar
  • 411
4 votes

Would it be wrong to say that the processor (and hardware) is the implementation of an interpreter for machine language?

If you look too much at words, they'll scurry away. In general the boundaries on meanings of words are soft. As others said, you are not wrong. But, the word interpreter is usually used precisely to ...
Pablo H's user avatar
  • 211
4 votes

Is bytecode ("virtual machine code") inherently faster to compile and/or interpret, than higher level (above Assembly) languages?

does the bytecode map to the machine instructions of the underlying processor more easily than some higher level language? That depends entirely on the bytecode, the higher level language, and the ...
Jörg W Mittag's user avatar
3 votes

Would it be wrong to say that the processor (and hardware) is the implementation of an interpreter for machine language?

You can call everything everything - in 2021, all of our components (CPUs, machine code, compilers, interpreters) share so many aspects, that you'll find an argument in almost any direction. Maybe it ...
AnoE's user avatar
  • 1,273
3 votes

Would it be wrong to say that the processor (and hardware) is the implementation of an interpreter for machine language?

TLDNR: No, not wrong. The words we use are part of communication: you think - you say - I hear - I interpret. Depending on the context the word "interpreter" may be understood quite ...
ghellquist's user avatar
3 votes

Is this a proper LL(1) Grammar?

It's a perfectly valid grammar, and it's certainly LL(1). But since it only generates three sentences, it's probably not what you are looking for. The three sentences: ...
rici's user avatar
  • 12k
3 votes
Accepted

How is code executed in the computer

I mean how the interpreter executes a code without translating it into machine code TL;DR It's the interpreter's (machine) code that executes your program's code. To explain it better, consider these ...
melfnt's user avatar
  • 613
3 votes
Accepted

Intermediate Representation vs Byte Code

This is from just the summary of the article, and I'm not sure that it is a terribly helpful one. What I think the author was trying to say is that the difference between 2 and 3 is who translates the ...
Pseudonym's user avatar
  • 22.2k
3 votes
Accepted

Closures break induction in correctness proof of interpreter

You must strengthen the theorem to be proved by induction. In the $e_1e_2$ case, the current induction hypothesis just tells you that $e_1$ reduces to a closure, but not anything more about how the ...
Li-yao Xia's user avatar
2 votes
Accepted

How does literals in compiled languages differ from literals in interpreted languages?

A literal is a piece of data which gets its value at compile time. I don't think that's a good definition of literals. A literal is a source-code token that represents a fixed value of some type. For ...
David Richerby's user avatar
2 votes

How can a stack-based VM be Turing-Complete?

I know this is an old thread, but I feel this answer can add some to the question. I recently implemented a virtual machine that uses only a single stack, but is Turing complete: the thing that makes ...
brandonmack's user avatar
2 votes
Accepted

Can Tree Transducers Self-Interpret?

Not in any straightforward way, because a tree transducer only accepts a single input, while an interpreter needs two inputs. An interpreter needs two inputs: a transducer $R$ and a tree $T$, and ...
D.W.'s user avatar
  • 160k
2 votes
Accepted

Implicit complexity and interpretation of total languages

As concluded via non-direct means in discussion interpreting a polytime program cannot be done in polynomial time in general. The following example shows this directly. The trick is that for the ...
Jake's user avatar
  • 3,810
2 votes

Do you ever "download" a language?

Any Compiler, Interpreter, Assembler performs the task to encode the programming language into strings of binary instructions that the host system's processor could understand. No matter what high-...
rsonx's user avatar
  • 281
2 votes

Is it possible to encode logical expression and interpret it with SQL?

Using disjunctive normal form (DNF) representation. The following 3 tables arrangement seems to solve the problem (NB: using better names for tables, not same as in the question): ...
Roman Susi's user avatar
2 votes

How is code executed in the computer

I mean how the interpreter executes a code without translating it into machine code. There is a fuzzy line between interpreters and compilers, but the basic idea is this: If it is translated into ...
Pseudonym's user avatar
  • 22.2k

Only top scored, non community-wiki answers of a minimum length are eligible