Questions tagged [interpreters]

Interpreters are tools to execute a programme or a script by reading statements written in a programming language and performing the actions required according to the semantics of the interpreted language.

Interpreters are tools to execute a programme or a script by reading statements written in a programming language and performing the actions required according to the semantics of the interpreted language.

96 questions
168
votes
1 answer

Understanding the differences: traditional interpreter, JIT compiler, JIT interpreter and AOT compiler

I'm trying to understand the differences between a traditional interpreter, a JIT compiler, a JIT interpreter and an AOT compiler. An interpreter is just a machine (virtual or physical) that executes instructions in some computer language. In that…
Aviv Cohn
  • 21,190
  • 31
  • 118
  • 178
82
votes
5 answers

Is Python Interpreted or Compiled?

This is just a wondering I had while reading about interpreted and compiled languages. Ruby is no doubt an interpreted language since the source code is processed by an interpreter at the point of execution. On the contrary C is a compiled…
crodjer
  • 1,039
  • 1
  • 9
  • 10
75
votes
10 answers

Why was the first compiler written before the first interpreter?

The first compiler was written by Grace Hopper in 1952 while the Lisp interpreter was written in 1958 by John McCarthy's student Steve Russell. Writing a compiler seems like a much harder problem than an interpreter. If that is so, why was the first…
anguyen
  • 861
  • 2
  • 7
  • 10
61
votes
14 answers

Can we make general statements about the performance of interpreted code vs compiled code?

I'm comparing two technologies in order to reach a recommendation for which one should be used by a company. Technology A's code is interpreted while technology B's code is compiled to machine code. In my comparison I state that tech B in general…
EpicSam
  • 870
  • 1
  • 6
  • 10
48
votes
6 answers

Does an interpreter produce machine code?

I study the topics of compilers and interpreters intensively. I want to check if my base understanding is right, so let's assume the following: I have a language called "Foobish" and its keywords are 'TEXT', ; So if I…
GrayFox
  • 619
  • 1
  • 5
  • 3
36
votes
3 answers

Why isn't there a python compiler to native machine code?

As I understand, the cause of the speed difference between compiled languages and python is, that the first compiles code all way to the native machine's code, whereas python compiles to python bytecode, to be interpreted by the PVM. I see that this…
user2986898
  • 471
  • 1
  • 4
  • 4
36
votes
6 answers

Why is studying a Lisp interpreter in lisp so important?

I have seen many CS curriculums and learning suggestions for new programmers that call for the aspiring programmer to study a Lisp interpreter that is specifically written in Lisp. All these sites say things similar to, "its an intellectual…
32
votes
7 answers

Interpreted vs Compiled: A useful distinction?

A lot of questions get asked here about interpreted vs compiled language implements. I'm wondering whether the distinction actually makes any sense. (Actually the questions are usually about languages, but they are really thinking about the most…
Winston Ewert
  • 24,732
  • 12
  • 72
  • 103
27
votes
10 answers

Can compilers and interpreters have bugs, and what can we (as users) do to deal with them?

If a compiler's work is essentially translating source code into machine level code, can there be any glitch in a compiler, i.e. a faulty "translation?" The same goes for an interpreter: can it fail to output the required content sometimes? I have…
Witch-King
  • 477
  • 4
  • 7
26
votes
10 answers

Why are commonly compiled languages not interpreted for faster iteration?

We're all too familiar with waiting for compilation, especially on large projects. Why isn't a thing to interpret a codebase for quick iterative development instead of generating code for a binary each time? Is that because if we are compiling at…
gust
  • 377
  • 3
  • 5
26
votes
2 answers

What semantic features of Python (and other dynamic languages) contribute to its slowness?

I don't know very well Python. I'm trying to understand more precisely what exact features of dynamic languages (à la Python, Lua, Scheme, Perl, Ruby, ....) are forcing their implementations to be slow. As a case in point, Lua 5.3 metatable…
Basile Starynkevitch
  • 32,434
  • 6
  • 84
  • 125
25
votes
3 answers

In which process does syntax error occur? (tokenizing or parsing)

I'm trying to understand compilation and interpretation, step by step figuring out a total image. So I came up to a question while reading http://www.cs.man.ac.uk/~pjj/farrell/comp3.html this article It says : The next stage of the compiler is…
FZE
  • 469
  • 4
  • 12
24
votes
2 answers

Is it possible to create a "bootstrapped" interpreter independent of the original interpreter?

According to Wikipedia, the term "bootstrapping" in the context of writing compilers means this: In computer science, bootstrapping is the process of writing a compiler (or assembler) in the source programming language that it intends to compile.…
Christian Dean
  • 2,790
  • 1
  • 22
  • 38
24
votes
4 answers

How does Chrome V8 work? And why was JavaScript not JIT-Compiled in the first place?

I have been researching Interpreters/Compilers, then I stumbled across JIT-Compilation - specifically Google Chrome's V8 Javascript Engine. My questions are - How can it be faster than standard Interpretation? Why wasn't JIT-Compilation used in the…
b0yfriend
  • 669
  • 2
  • 6
  • 9
13
votes
3 answers

How are variables stored in a language compiler or interpreter?

Say we set a variable in Python. five = 5 Boom. What I'm wondering is, how is this stored? Does the compiler or interpreter just put it in a variable like so? varname = ["five"] varval = [5] If this is how it is done, where is that stored? It…
baranskistad
  • 254
  • 2
  • 7
1
2 3 4 5 6 7