64 votes
Accepted

What properties of a programming language make compilation impossible?

The distinction between interpreted and compiled code is probably a fiction, as underlined by Raphael's comment: ...
user avatar
  • 19.1k
30 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 ...
user avatar
  • 19.1k
17 votes

What properties of a programming language make compilation impossible?

The question is not actually about compilation being impossible. If a language can be interpreted¹, then it can be compiled in a trivial way, by bundling the interpreter with the source code. The ...
user avatar
13 votes

What properties of a programming language make compilation impossible?

I think the authors are assuming that compilation means the source program doesn't need to be present at run-time, and no compiler or interpreter needs to be present at run-time. Here are some ...
user avatar
  • 4,224
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 ...
user avatar
  • 22.1k
11 votes
Accepted

Is it possible to go from code to circuit?

Yes, it is certainly possible. There are compilers that will compile from code to circuits. Classic examples would be VHDL or AHDL compilers, but you can certainly do this for any other language, to ...
user avatar
  • 143k
8 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-...
user avatar
8 votes

What properties of a programming language make compilation impossible?

it is possible the current replies are "overthinking" the statement/ answers. possibly what the authors are referring to is the following phenomenon. many languages have an "eval" like command; eg see ...
user avatar
  • 10.8k
8 votes
Accepted

What are potential pitfalls with having a minimal kernel that runs managed code?

Depending on the language, there can be many development challenges: Pointers: If a language doesn't have pointers, it will be a challenge to do relatively-easy tasks. For example, you can use ...
user avatar
  • 386
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 ...
user avatar
  • 211
7 votes

Interpretation in scripting languages

Scripting languages are a class of programming languages. This class is rather fuzzily defined. One possible definition is that they're languages that are designed to automate small tasks, rather ...
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 ...
user avatar
7 votes

is there any hardware device to convert source code into machine language?

No, and yes. The answer is "no", in the sense that the vast majority of computers have no hardware that does what you typically expect a compiler to do; compilers are written in software. Obviously ...
user avatar
  • 19.1k
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 ...
user avatar
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 ...
user avatar
  • 187
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 ...
user avatar
  • 433
5 votes

What are potential pitfalls with having a minimal kernel that runs managed code?

I have heard it claimed (by a researcher working on a competing microkernel technique) that very little is known about how to evaluate security of systems that are extensible through managed code. ...
user avatar
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. ...
user avatar
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 ...
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 (...
user avatar
  • 13.7k
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 ...
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 ...
user avatar
  • 181
3 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 ...
user avatar
  • 71.1k
3 votes

What properties of a programming language make compilation impossible?

LISP is a terrible example, as it was conceived as a sort of higher-level "machine" language as a base for a "real" language. Said "real" language never materialized. LISP machines were built on the ...
user avatar
  • 13.7k
3 votes

Does interpreter for language L1 have to be written in lower level language L0?

I think the implication of your Tanenbaum quote is that there is no compiler for L1. In which case yes, the interpreter does have to be written in another language (how else would you run the ...
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: ...
user avatar
  • 11.3k
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 ...
user avatar
  • 593
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 ...
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 ...
user avatar
  • 1,155

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