Translators Flashcards

(14 cards)

1
Q

What is a Translator?

A

Translators convert source code from a high-level language to a low-level language.

Translators facilitate the execution of programs by transforming code into a format that can be understood by machines.

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

What are the three main types of translators?

A
  • Interpreters
  • Compilers
  • Assemblers

Each type of translator has distinct characteristics and use cases.

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

What do Interpreters do?

A

Interpret source code line-by-line and executes it on the fly.

Interpreters are easier to debug and allow for incremental testing.

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

What are the advantages of using Interpreters?

A
  • Easier to debug
  • Allows incremental testing
  • Faster to start execution

Despite their advantages, interpreters have slower execution times overall.

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

What are the disadvantages of using Interpreters?

A
  • Slower execution time overall
  • Requires the interpreter to be present during execution

This can limit the portability of applications.

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

What do Compilers do?

A

Translates the entire source code into machine code at once and then executes it.

Compilers optimize performance and do not require the compiler during execution.

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

What are the advantages of using Compilers?

A
  • Faster execution time
  • No need for the compiler during execution

This enhances the efficiency of the final program.

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

What are the disadvantages of using Compilers?

A
  • Longer initial compilation time
  • Can be more challenging to debug

The compilation process can be time-consuming, especially for large programs.

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

What do Assemblers do?

A

Translate assembly language into machine code.

Assemblers work specifically with low-level languages, unlike interpreters and compilers.

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

How do Assemblers differ from Interpreters and Compilers?

A

Assemblers deal with low-level languages, while interpreters and compilers work with high-level languages.
Assemblers translate assembly language directly into machine code

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

What is the programming language and its corresponding translator for C?

A

Compiler

C is a commonly used programming language, often compiled for performance.

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

What is the programming language and its corresponding translator for Python?

A

Interpreter

Python is known for its ease of use and is typically executed using an interpreter.

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

Fill in the blank: Assembly Language is translated by a _______.

A

Assembler

Assemblers are specifically designed to convert assembly language into machine code.

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

What is the programming language and its corresponding translator for JavaScript?

A

Interpreter

JavaScript is widely used for web development and is executed in real-time by interpreters.

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