Translators (OCR A-Level Computer Science): Flashcards
Practise the cards
15 cards from this deck
ShowHide
Practise the cards
15 cards from this deck
Why are translators needed?
Why are translators needed?
Convert code to machine code for computer execution
Three main types of translators
Three main types of translators
Compilers, interpreters, assemblers
What does a compiler do?
What does a compiler do?
Translates entire program to machine code in one go
When does a compiler report errors?
When does a compiler report errors?
After translating entire program (batch reporting)
Compiler speed advantage
Compiler speed advantage
Pre-compiled code runs faster (no runtime translation)
Main compiler drawback
Main compiler drawback
Long initial translation; must fix all errors before running
What does an interpreter do?
What does an interpreter do?
Translates & executes code line-by-line at runtime
When does an interpreter report errors?
When does an interpreter report errors?
Immediately as they occur (real-time debugging)
Interpreter development benefit
Interpreter development benefit
Easier debugging; immediate error feedback & flexibility
Interpreter speed drawback
Interpreter speed drawback
Slower execution (translates line-by-line during runtime)
What does an assembler do?
What does an assembler do?
Translates assembly language to machine code
Assembly language translation type
Assembly language translation type
One-to-one correspondence with machine instructions
Assembler main benefit
Assembler main benefit
High efficiency & direct hardware control
Assembler portability issue
Assembler portability issue
Hardware-specific; code rewritten for different processors
Compiled vs interpreted code speed
Compiled vs interpreted code speed
Compiled code runs faster than interpreted code
