Video Title: Topic/SLR:
COMPILERS AND INTERPRETERS
Date Due:
Questions Notes
What is assembly code? Assembly Code is translated into machine code using an assembler.
High-level Source code is translated into machine code using either:
What are the 2 factors Interpreter
that source code is Compiler
translated using? Compiler
Our code will not run when we have a syntax error
What is a compiler? We have an error on line 2 which prevents our programs from running
Prin(counter)
What is an Interpreter? This error needs correcting before the program will run as shown here
List One advantage and Interpreters
one disadvantage of This is the same program as the one we just saw in Python
Interpreters. This time, it was written in an early high-level language called BBC basic
If we run the program on lines 20 and 30 we are both translated and run
You can see it outputs the value of the counter here
Advantages for Interpreters:
Compilers: Disadvantages
Disadvantagesfor forInterpreters:
Compilers:
Easy to write
No need source code
for translation software Translation
Source code Software
is easieristo
needed
write in a
because the program will always
at run time athigh-level
run time language, but the
run,
Speedstopping when is
of execution it faster
finds a Speed
programof execution is slower
will not run with syntax
syntax
Code iserror
usually optimised Codeerrorsis not
whichoptimised
can make it more
Code does
Original not need
Source Codeto is be
kept Source code
difficult is needed
to write the code
recompiled
secret when code is Code needs to be recompiled
changed, and it's easy to try out when the code is changed
commands when the program Designed for a specific type of
has paused after finding an processor
error
This makes interpreted
languages very easy for
beginner programmers to learn
to write code
Summary:
Assembly code is translated into machine code using an assembler, while high-level
source code is translated into machine code using an interpreter or compiler.
Compilers have advantages like faster execution, optimized code, and secret source
code. Interpreters have advantages like easy writing, recompilation, and a specific
processor type, but also require translation software at runtime.
Key Terms Marking
To Complete-0
Partially Completed-1
Completed-2
High Standards of Presentation &
Completeness-3