Week 1 (1.1) Flashcards

1
Q

What is a programming language?

A

A notation for describing computations to people and machines.

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

Why are programming languages crucial in the modern world?

A

Because all the software running on computers was written in some programming language.

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

What must happen before a program can be executed by a computer?

A

It must be translated into a form executable by the computer.

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

What is a compiler?

A

A software system that translates a program from a source language into a target language.

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

What are some domains influenced by compiler design principles?

A

Programming languages, machine architecture, language theory, algorithms, and software engineering.

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

What is the difference between a compiler and an interpreter?

A

A compiler translates a source program into a target program, while an interpreter executes the source program directly.

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

What are bytecodes in Java processing?

A

An intermediate form that Java source code is compiled into before being interpreted by a virtual machine.

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

What is a just-in-time (JIT) compiler?

A

A compiler that translates bytecodes into machine language immediately before running the program.

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

Why might a compiler produce assembly language as its output?

A

Because assembly language is easier to produce and debug compared to machine language.

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

What is the role of a preprocessor in language processing?

A

It collects source program modules, expands macros, and generates a modified source program.

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

What does an assembler do in a language-processing system?

A

Converts assembly-language programs into relocatable machine code.

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

What is the purpose of a linker?

A

To combine relocatable object files and library files into executable machine code.

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

What is a loader in the context of language processing?

A

A program that places executable object files into memory for execution.

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

What is a source-to-source translator?

A

A compiler that translates a high-level language into another high-level language.

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

What is an advantage of using C as a target language in a compiler?

A

C is widely supported and allows compilers to leverage existing tools and libraries.

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

What advantages does a compiler have over an interpreter?

A

Faster execution of the translated target program.

17
Q

What advantages does an interpreter have over a compiler?

A

Better error diagnostics as it executes the program statement by statement.