Types of translators
There are 3 types of translators to be aware of: assemblers, compilers and interpeters
Assemblers convert each assembly instruction to a machine code instruction in a simple one to one process. High level code can be ranslated using either a cmpiler or translator. You can see the differences between them below.
Feature |
Interpreter |
Compiler |
Process |
Translates one line of code at a time and runs it. |
Translates the entire code all at once and creates object code that can be run. |
Execution |
Executes slower as each line must first be interpreted. |
Executes faster as the whole program is in machine code already. |
Requirements |
Users must have the interpreter installed to run the code. |
Users do not need a compiler installed to run the object code. |
Security |
Users can see the source code and could copy it. |
The source code is secure when distributing object code. |
Uses |
Program development as it stops when an error is found and when the program needs to work on multiple platforms. |
Proprietary software and software that will run frequently. |
Bytecode
Bytecode is a form of intermediate translation that allows code to then be interpreted by different families of process by using an appropriate bytecode interpreter. This gives a non-human readable form of code that can be
distributed that will run faster than code that needs to be fully interpreted but work on more than one architecture. Many phone apps are translated to bytecode.