3 - Compilers and Interpreters Flashcards
1
Q
What’s the difference between a compiler, assembler and interpreter?
A
- Compilers translate from HILL to machine code.
- Assemblers translate mnemonic machine instructions (like MOV, ADD) to binary code.
- Interpreter acts like a compiler but never translates to binary, it just analyses, works out your intentions and executes.
2
Q
What advantage does a compiler have over an interpreter?
A
It’s much faster.
3
Q
What advantage does a interpreter have over an compiler?
A
- Platform independent
- More suitable for rapid prototyping and when the program is frequently modified.
- Easier to debug.
- Easier to make and use
4
Q
What comprises does one have to choose between when deciding between a compiler and an interpreter?
A
A compromise between speed and ease of use.
5
Q
What ‘code’ does Java compiler to?
A
Java compiles to ‘Byte’ code.
Java Virtual Machine (JVM) uses both a compiler and interpreter.
6
Q
What compiler does C use?
A
Just in Time (JIT) ?
7
Q
Can can you reuse exsiting proven software?
A
Essentially by using libraries:
- source-level subroutines and macro libraries
- pre-translated relocatable binary libraries
- dynamic libraries and dynamic linking