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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What advantage does a compiler have over an interpreter?

A

It’s much faster.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What ‘code’ does Java compiler to?

A

Java compiles to ‘Byte’ code.

Java Virtual Machine (JVM) uses both a compiler and interpreter.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What compiler does C use?

A

Just in Time (JIT) ?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly