<aside>
👀 Computers only understand machine code (binary), this is an issue because programmers prefer to use a variety of high and low-level programming languages instead.
</aside>
- To get around this issue, the high/low-level program code (source code) needs to be passed through a translator which converts to machine code
Assembler
- Assembly Code —> Machine Code
<aside>
💡 Used to translate a program written in a low-level (assembly) language into a machine code file, so it can be used and executed by the computer - the odd one out.
</aside>
- Once assembled once, the program file can be used again and again without re-assembly
- Creates object code prior to execution
- Assembly code has a one-to-one mapping between the mnemonic instructions of the language and their binary code equivalents
- Symbol table is used to map the mnemonic to the binary equivalent
- Allows for greater control over memory usage
- Used to directly program the CPU
Interpreter
<aside>
💡 Able to read, translate and execute one statement (line) at a time from a high-level program.
</aside>
- Converts each line and executes it before moving onto the next
- Stops when a line of code is reached that contains an error
- Often used during the development of a program as they make debugging much easier - each line of code is analysed and checked before execution
- Slower overall - An interpreted app does not produce an executable file thus source code must be interrupted each time the application is run
- Compatibility - A relevant interpreter needs to be installed on the running platform to run the source code
- Portable - can be run on multiple platforms as long as they have the required environment