Section 4 Chapter 22 - Programming Language Translators Flashcards
Assembler
A program that translates assembly language into machine code
Names of the input and output of an assembler
Source code and object code
Compiler
A program that translates a high level language into machine code
Why different platforms need different compilers
Because the object code that is produced is hardware specific
Interpreter
A programming language translator that translates each line of source code into object code and executes it, one line at a time. However the interpreter may check for syntax errors in the entire source code before running
Bytecode
A type of code that is obtained by compiling a program. It is not machine code and is platform independent.
How bytecode is run
It is executed by a bytecode interpreter
Advantages of bytecode (2)
- Platform independent
- Secure
Advantages of a compiler (4)
- The object code can be saved and run without recompiling the source code
- Object code executes faster than interpreted code
- The object code can be distributed without the compiler being present
- The object code is more secure as it is hard to understand
Advantages of an interpreter (2)
- It is useful for programming as there is no need for lengthy recompilation each time an error is found
- It is easier to partially test and debug programs`
Where interpreters are useful
Debugging and developing a program
Where compilers are useful
For running a program fast