Types of program Translators Flashcards
What is Source Code?
Source code is the language instructions that have been written by the computer programmer. The computer cannot execute the source code directly
What is Object Code?
Object Code (or executable code) is translated from the source code using an assembler or compiler into instructions that can be executed by the computer
What is an assembler?
The source code is written in assembly language, which is a series of memorable mnemonics used to represent machine operational codes; assembly code is the most difficult language to program and needs a high degree of expertise to write and debug it.
What are the advantages of an assembler?
Advantage: it is an efficient low-level language that can be translated quickly as it has a one-to-one relationship with machine code.
What are the disadvantages of an assembler?
Disadvantage: it is complex to write and takes lots of programming time and expertise
What is an compiler?
The source code created by the programmer is not understandable by the computer. A software application called a compiler converts the source code to object code, which the computer can run. The object code is converted to match the target computer that will run the software.
What are the advantages of an assembler?
Advantage: an executable file is produced which runs without the need of the source code; this makes the source code more secure as it does not need to be distributed to the customer
What are the disadvantages of an assembler?
Disadvantages: compilation of a large program takes a long time to complete and any errors in the source code need to be corrected before an executable file can be produced; so, if there are any errors, it is necessary to correct them and recompile the source code.
What is intermediate language?
Some compilers create a final output in an intermediate language, such as bytecode; the output is designed to run on a virtual machine (VM) rather than on a central processing unit (CPU). This ensures that the compiled program is portable and not machine dependent when in VM format.
What is an bytecode interpreter?
A bytecode interpreter is used to translate the VM code into machine language for the target machine before the code is executed. Although the bytecode interpretation takes time, the final compiled program for the machine is more efficient than if the source code was compiled directly; this approach is used by Adobe Flash and Java.
What is an interpreter?
Interpreter software normally executes the source code directly, it is translated line by line; this avoids the need to compile the program.
Which ones runs more slower out of an compiler and interpreter?
Interpreted software runs more slowly than compiled software as each statement in the program is analysed before it is executed.
What is an advantage of an interpreter?
Advantage: during development the programmer might make frequent changes, which can be tested without going through the time-consuming process of compiling and linking for each change
What is an disadvantage of an interpreter?
Disadvantage: the interpreter needs to be loaded on the target computer, where it will create efficient machine code at runtime.
Additionally, the source code is available to the customer and the line-by-line translation method takes longer than a compiled program to run.