2.5 - Languages & Translators Flashcards

1
Q

What is a high-level programming language?

A
  • Uses syntax similar to a natural human language to make it easier to understand and use
  • Must be translated into machine code before it can be run
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the pros/cons of high-level languages?

A
  • More easily written and understood by humans
  • Portable (can be run on many different CPUs)
  • Slow to run
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a low-level language?

A

Does not closely resemble a natural human language making it harder for humans to understand and use

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

State the pros/cons of low-level languages

A

-Low-level languages are easier to optimise

-Low-level languages allow the user to directly manipulate memory

-Low-level languages are specific to particular CPUs

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

What are the two types of low-level language?

A
  • Machine Code
  • Assembly Language
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is machine code?

A

Binary

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

What is assembly language?

A

Uses specialised command mnemonics to perform actions

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

Why do computers use binary?

A

Computers are made up of millions of transistors (switches) which can only represent two states (ON and OFF)

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

What are the two types of translator?

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

What are 2 differences between compilers and interpreters?

A

Execution method:
- Interpreters translates the source code into machine code line-by-line
- Compilers translate all the source code into machine code in one go and produce an executable file

Execution speed:
- Interpreters are slower than compilers because the code must be reinterpreted each time the program is run
- Compilers can produce much more efficient code than interpreters, making the compiled programs run faster

Complexity:
- Interpreters are smaller, simpler programs
- Compilers are large, complex programs

Error reporting:
- Interpreters report errors to the user immediately and stops translation
- Compilers produces all the errors in an error file at the end of compilation

Repetition:
- Interpreters must reinterpret the program every time
- Compilers doesn’t need reinterpretation, but must be re-compiled after changes are made

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

What are the benefits of using a compiler?

A
  • Produces an executable program: No need to repeat this process more than once per version of the software
  • Hides the source code from the end user: Protects developers’ intellectual property
  • Source code not needed afterwards
  • Fast to execute afterwards
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the drawbacks of using a compiler?

A

-Very slow compilation process: This can slow down development if many small changes need to be made

  • Errors only shown right at the end
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the benefits of using an interpreter?

A

-Interpreted languages are ‘portable’: This means that they can be run on many different types of CPU as long as there is an interpreter available for the platform
- Errors discovered straight away
- Good for small changes

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

What are the disadvantages of using an interpreter?

A
  • Source code needed to run
  • Slower to execute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the purpose of the IDE (Integrated Development Environment)?

A

Provides programmers with tools to help create programs

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

What are some of the functions of the IDE?

A
  • Editor
  • Translator
  • Break point
  • Variable watch/watch window
  • Trace
  • Error diagnostics and debugger
  • Run time environment
17
Q

What does the editor do?

A

Allows a programmer to enter and edit source code - Features may include:
- Automatic formatting
- Automatic line numbering
- Automatic colour coding
- Statement completion.

18
Q

What does a break point do?

A

Allows the programmer to select a specific line and the program displays variable values at that point - a process called single-stepping

19
Q

What does a variable watch / watch window do?

A

Displays the current value of a selected variable which can be watched line-by-line to see how the value changes

20
Q

What does trace do?

A

Logs the values of variables and outputs of the program as the code is executed line by line

21
Q

What do the error diagnostics and debugger do?

A
  • Displays information about an error when it occurs, such as the line it occurred on and the error type
  • May also suggest solutions to help the programmer find and fix the error
22
Q

What does a runtime environment do?

A

Checks for runtime errors and allows user to run and test the program