Compiler Construction


Difference between compiler and interpreter



Download 1.49 Mb.
Page13/14
Date15.03.2021
Size1.49 Mb.
#56076
1   ...   6   7   8   9   10   11   12   13   14
Compiler Construction lec 01

Difference between compiler and interpreter


Interpreter

Compiler

Translates program one statement at a time.

Scans the entire program and translates it as a whole into machine code.

Interpreters usually take less amount of time to analyze the source code. However, the overall execution time is comparatively slower than compilers.

Compilers usually take a large amount of time to analyze the source code. However, the overall execution time is comparatively faster than interpreters.

No intermediate object code is generated, hence are memory efficient.

Generates intermediate object code which further requires linking, hence requires more memory.

Programming languages like JavaScript, Python, Ruby use interpreters.

Programming languages like C, C++, Java use compilers.
  • The machine-language target program produced by a compiler is usually much faster than an interpreter at mapping inputs to outputs . An interpreter, however, can usually give better error diagnostics than a compiler, because it executes the source program statement by statement.
  • Some languages combine interpretation with compilation like java
  • A Java source program may first be compiled into an intermediate form called bytecodes. The bytecodes are then interpreted by a virtual machine. A benefit of this arrangement is that bytecodes compiled on one machine can be interpreted on another machine, perhaps across a network

Download 1.49 Mb.

Share with your friends:
1   ...   6   7   8   9   10   11   12   13   14




The database is protected by copyright ©ininet.org 2024
send message

    Main page