Languages and Translators Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a high-level language?

A

A language that is programmer friendly. It is easy for humans to understand, debug and maintain

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

What type of translator does a HL language need?

A

Needs a compiler or interpreter to translate into machine code

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

What are some examples of HL languages?

A

Python
JavaScript
C#
C++
Ruby

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

What are the advantages of HL languages?

A

Hardware independent; can run on any system and are easily portable from one device to another

Little to no hardware knowledge is required to write programs

Syntax very similar to English language, therefore easier to write, understand and debug

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

What are the disadvantages of HL languages?

A

Not memory efficient -> consumes more memory than LL languages

Must be compiled/interpreted before it can be run

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

What is a low-level language?

A

A language that is machine-friendly. It is difficult for humans to understand, but easy for a machine to interpret

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

What type of translator do LL languages require?

A

Needs an assembler for direct translation of the language instructions

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

What are the examples of LL languages?

A

Machine language
Assembly language

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

What are the advantages of LL languages?

A

Memory efficient
Execute very quickly

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

What are the disadvantages of LL languages?

A

Hard for humans to read and knowledge of hardware is a prerequisite to write programs

Very machine-dependent and not portable between different devices

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

What is machine code?

A

Binary representation of instructions in a format that the CPU can decode and execute

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

What are the three types of translators?

A

Compiler
Interpreter
Assembler

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

What does an Assembler do?

A

Translates assembly language into machine code

Converts basic commands and operations into binary code that can be understood by a specific type of processor

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

What are the advantages of Assemblers?

A

Programs written in machine language can be replaced with mnemonics

Memory efficient

Speed of execution is faster

Hardware-oriented

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

What are the disadvantages of Assemblers?

A

Takes a long time to write the program and it is difficult to remember syntax

Lack of portability between computers of different makes can not have the same assembler

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

What does a compiler do?

A

Translates source code from HL languages into object code and then machine code

The whole program is translated into machine code before it is run

After compilation, the compiler provides an error report for the whole code

17
Q

What are the advantages of Compilers?

A

No need for translation when running

Speed of execution is faster than interpreted code

Provides an executable file so that the original code doesn’t need to be compiled again

18
Q

What are the disadvantages of Compilers?

A

The program will not run with syntax error, which makes it more difficult to write long code

Code needs to be recompiled when it is changed

19
Q

What is an Interpreter?

A

Translates source code from HL languages into machine code

The program is translated line by line as it runs

Stops execution as soon as an error is found

20
Q

What are the advantages of Interpreters?

A

Easy to write source code, as the program will always stop when it finds a syntax error

Code does not need to be recompiled when code is changed

Easier for beginner programmers to learn to code

21
Q

What are the disadvantages of Interpreters?

A

The interpreter must be installed to run the program

Takes longer to execute as the instruction is translated before it is executed

Source code will be interpreted every time it is run

22
Q

Which HL languages are interpreted?

A

Python and JavaScript

23
Q

Which HL languages are compiled?

A

C# and VB