Computer Languages and Translators (Machine Code (This is the language the…
Computer Languages and Translators
This is the language the computer understands. In machine code, instructions are made up of binary numbers.
The machine code runs very quickly as it does not need to be translated
Machine code is very difficult for humans to read and understand
It is processor specific which means they can only run on the processor type they have been written on
High Level Languages
This was developed because machine code was to difficult to read and understand. High level languages make use of English words and phrases.
They contain English words and phrases so are easier to read and understand
It is easier to spot errors and bugs because they are easier to understand
They are portable which means that the program can run on more than one type of processor
They need to be translated into machine code, making them slower to run
Before high level languages can be understood and run by a computer they need to be translated into machine code.
An interpreter doesn't produce object code (a stand alone piece of code)
the interpreter translates and executes each line of the program in turn
If errors are present, then they are highlighted immediately and are therefore easier to detect and fix
Interpreters can run partial code or code under development
A translation is not saved, the interpreter must be present to run code
If code is repeated, as in a loop, the code is translated and run many times
individual runs are slower because of the previous two points
A complier translates high level language instructions, called source code, into machine code or object code. It does this by going through the source one line at a time and translating it. It puts the translation into a file and then moves on.
When the whole program has been translated, the object code can be run. There is no need to translate the source code again, unless the program is changed.
If there are syntax errors it lists them. The object code cannot be run until the whole program is translated
If no errors are found, then the source does not need to be translated again
The translator program is no longer required once the program is translated
If any syntax errors are present then the program will not run
The errors may be harder to correct, as the problems may not be identified until the code is translated