Translators Flashcards
High - Level Language
Computers need to translate it before they can read and run it.
Source code is easy for humans to understand
e.g. Python
Low - Level Language
Easy for computers to run
Tricky for humans to read and write
What does low - level language consist of?
Machine Code
Assembly Languages
Uses of high-level languages
One instruction of high - level code represents many instructions of machine code
Programmer can easily store data in data structures
Code is easy to understand, read, write
Uses of low-level languages
One instruction of assembly code represents one instruction of machine code
Code is difficult to understand, read, write
Machine code
Language that computer understands insructions in
2 types of translators
Compilers
Interpreters
What do compilers do:
Translate high - level code directly into machine code and create and executable file
What do interpreters do:
They take each instruction in the code and call machine code subroutines within their own code to carry out that instruction
Uses of a compiler:
Translates all the source code at the same time and creates one executable file
Only needed once to create the executable file
Returns a list of errors one compiling is complete
Once compiled the program runs quickly, but compiling takes a long time
Uses of an interpreter:
Translates + runs the source code one instruction at a time, does not create an executable file
Needed every time to run the program
WIll run the first error and stop - useful for debugging
Programs run slowly because code is being translated
What does the type of translator depend on?
The language being used