machine code is a series of numbers written in binary
each number represents a different instruction
programmers find reading machine code difficult
as a result programmers chose to write in high-level languages e.g python, VB,
High level languages must be converted into machine code
This is done by compilers, interpreter, assembler
Source code
term given to a set of instructions that are written in human readable programming languages. Source code must be translated into machine code before a computer can understand and execute it
Low level languages
languages that sit close to the computers instruction set (instructions a processor can understand)
types oflow level languages
machine code
assembly language
Assembly Language
uses mnemonics to form instructions that directly corresponds to machine code
a program written in a high level language is known as
source code
Translator
Converts source code (high level language) into machine code that a CPU can understand
Compiler
takes the source code as a whole and converts it into machine code all in one go. Once converted the object code can be run unassisted at any time
Advantages of Compilers
-runs quickly as they have already been translated
-program can be supplied as an executable file
-it is optimised code, so will run quicker and take up less memory
Disadvantages of compilers
-must be recompiled every time the programmer changes the program
-source code compiled on one platform cannot be run on another, specific to the processor's architecture
Interpreter
translates source code into machine code one instruction at a time and is then executed immediately
Advantages of interpreters
-instructions are executed as soon as they are translated
-errors can be quickly spotted as the program stops the second the error is found and identifies the issue
Disadvantages of interpreters
-programs run slowly as the processor must wait for each instruction one at a time
-program must be translated every time for it to run
-does not produce an executable file than can be distributed