Sec 4. Chap 22 : Programming language translators. Flashcards

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

Assembler.

A

Translated assembly language into machine code.

Assembly has a one to one relation with machine code. despite being partially in mnemonic form.

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

Compiler.

A

Translate source code from a high-level programming language to a lower level language to create an executable program.

Compilers scan through the source code several times, each time performing checks and building up a table of knowledge needed to produce an accurately reflective machine code object code.

Different processors have different architectures, and therefor each need a specific compiler. Compilers are not platform independent.

Once an object code is compiled it does not need to be be compiled again - saves time and protects source code.

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

Interpreter.

A

Interpreters translate code through a series of subroutines to carry out each high level instruction.

Interpreters view each line of the source line-by-line, and calls each specific subroutine to execute that line - an intermediate representation - which is then immediately executed.

Interpreters check language syntax - but not programme logic, so errors can come up later during the programme.

Interpreters do not produce an executable machine code, therefor is always indeed of an interpreter to run the code. This does not protect the source code from plagiarism.

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

Byte code.

A

Combines both compiling and interrupting. Usages intermediate representation which combines both.

Bytecode program may be executed by parsing and directly executing the instructions, one at a time.

Byte code can be run in a virtual machine through interpreting line-by-line the code, but also compiled to that specific cpu.

Byte code interpreters takes byte code and converts in into machine code for that particular processor.

Byte code can also be run on virtual machine (its own interpreter), as opposed to the actual pc - protects against harmful software.

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

Advantages of compilers over interpreters.

A

Compilers.

Object code only needs to be compiled once / and executes faster. Source code can not be stolen.

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

Advantages of interpreters over compilers.

A

Interpreters.
Useful for developers who do not need a lengthy compile time every time the programme is run. Also an easier process to debug because it always crashes where the code is faulty.

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