title=Fundamentals of Computer Systems: Types of program translator
An assembler translates assembly language into machine code. Assembly language consists of mnemonics for machine opcodes so assemblers perform a 1:1 translation from mnemonics to a direct instruction. For example:
LDA #4 converts to
Conversely, one instruction in a high level language will translate to one or more instructions at machine level.
Advantages of using an Assembler:
Disadvantages of using Assembler:
A Compiler is a computer program that translates code written in a high level language to a lower level language, object/machine code. The most common reason for translating source code is to create an executable program (converting from a high level language into machine language).
Advantages of using a compiler
Disadvantages of using a compiler
An interpreter program executes other programs directly, running through program code and executing it line-by-line. As it analyses every line, an interpreter is slower than running compiled code but it can take less time to interpret program code than to compile and then run it — this is very useful when prototyping and testing code. Interpreters are written for multiple platforms, this means code written once can be run immediately on different systems without having to recompile for each. Examples of this include flash based web programs that will run on your PC, MAC, games console and Mobile phone.
Advantages of using an Interpreter
Disadvantages of using an Interpreter
A compiler makes faster, more secure code
Interpreters allow for code to run on multiple platforms, it allows you to debug and test code without having to re-compile the entire source code
Compiler: as it produces faster code. Also object code that is produced is difficult to read, meaning competitors won't easily be able to steal or users hack the code.
Interpreter (harder to get marks for this): As more and more developers create games for multiple platforms, an interpreted language would allow for code written once to be run on different consoles and even phone platforms
Interpreter : Students will be using different operating systems and hardware at home, so it is necessary to create code that is multi-platform. As it is an educational tool, it probably wouldn't need the speed boost that a compiler would provide.