2.5 Languages And Translators Flashcards
What are high level languages?
Code written similar to human language
Easier to understand and use
Fewer errors
More complex and powerful commands
Must be translated into machine code as cannot be directly executed by CPU
What are low level languages?
Don’t closely resemble human language, making it harder for humans to understand and write in
Used when a program must be executed quickly as interacts directly with hardware
Machine code
Pure binary code that computers can directly process and execute
Tedious for humans to understand and write
Very specific commands
Execute fastest, no need for translation
Assembly language
Specialised command mnemonics to perform actions
Easier to understand and spot errors
Faster to execute than high level because it is used to directly control the CPU
Translator
Changes a program written in one language to another
Interpreter
Translates source code one line at a time into machine code
Slower than compiler because code must be reinterpreted each time the program is run
Smaller, simpler, programs
Report errors immediately and stops program from running
Can be edited and run without translating whole program
Reinterpret program every time it is run
Compiler
Translates source code into machine code all in one go and produces an executable file that can run on other machines
More efficient code, runs faster
Large complex programs
Analyse entire program to produce error file
Analysis only required once
Recompiled if any changes are made
Editor
Nuer and edit source code
Automatic formatting, line numbering, colour coding, statement completion
Compilers and interpreters
Translators
Breakpoint
Selects a specific point and displays variable value at that point
Code executed one line at a time to find error
Variable watch
Displays current value of a selected variable
Trace
Logs values of variables and outputs of the program as the code is executed line by line
Error diagnostics
Display information about an error, such as line number and error type
Runtime environment
Checks for runtime errors
Allows trace and breakpoint to be used