Difference between revisions of "Programming Language Translators"
Line 7: | Line 7: | ||
=Interpreter= | =Interpreter= | ||
An interpreter also translates code written in a programming language into object code, but unlike a compiler it does this one line of code at a time. This makes it slower to run than a compiler, but interpreters are useful for partially testing or debugging programs. | An interpreter also translates code written in a programming language into object code, but unlike a compiler it does this one line of code at a time. This makes it slower to run than a compiler, but interpreters are useful for partially testing or debugging programs. | ||
+ | |||
+ | =Compiler vs Interpreter= | ||
+ | |||
+ | =Byte Code= | ||
+ | |||
+ | =Object Code= | ||
+ | |||
+ | =Machine Code= | ||
+ | |||
+ | =Byte Code= |
Revision as of 08:45, 23 March 2017
Contents
Assembler
An assembler translates assembly language into machine code.
Compiler
A compiler translates code written in a high level programming language into object code, the machine code of a particular machine. It 'compiles' the entire source code before translating it. The compiler has several advantages over interpreters, such as: the object code is saved, meaning there is no need to re-compile; compiled code executes faster than interpreted code; the object code can easily be distributed without the compiler; and compiled code is more secure, as it is harder to reverse engineer than interpreted code.
Interpreter
An interpreter also translates code written in a programming language into object code, but unlike a compiler it does this one line of code at a time. This makes it slower to run than a compiler, but interpreters are useful for partially testing or debugging programs.