Translators Flashcards

1
Q

Why do we need translators?

A

Programs must be translated into machine code before the processor can execute them

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

What does a compiler do?

A

Translates the source code into a standalone, machine code program

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

What does an interpreter do?

A

Translates the code line by line into machine code

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

Advantages of a compiler? (3)

A
  • Translation is done once separately
  • Translated programs run faster
  • Protects source code from competitors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Disadvantages of a compiler? (2)

A
  • Errors are only reported at the end of a compilation attempt
  • To make edits, you must recompile the edited source code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Advantages of an interpreter? (3)

A
  • Error messages are reported as soon as they are identified, and pinpoint the error
  • Code is not platform specific
  • Program can be easily edited
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Disadvantges of an interpreter? (1)

A

Every line must be translated every time, so it is slower to run

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