Vous êtes sur la page 1sur 13

LANGUAGES AND

TRANSLATORS
By Hamna Jawad
COMPUTER PROGRAM
• A computer program is a list of
instructions that enable a
computer to perform a specific
task.
• Computer programs can be
written in high-level or low-level
languages, depending on the
task and the computer.
HIGH-LEVEL LANGUAGES
• High-level languages are written in a form that is close to our
human language, enabling to programmer to just focus on the
problem being solved.
• No particular knowledge of the hardware is needed as high level
languages create programs that are portable and not tied to a
particular computer or microchip.
• Examples include: C++, Java, Pascal, Python, Visual Basic.
ADVANTAGES
• Easier to read as it uses English like
statements
• Easier/faster to write code as it uses English
like statements
• Easier to debug during development
• Easier to maintain once in use
• Portable code – not designed to run on just
one type of machine
LOW-LEVEL LANGUAGES
• Low level languages are used to write programs that relate
to the specific architecture and hardware of a particular
type of computer.
• They are closer to the native language of a computer
(binary), making them harder for programmers
to understand.
• Low level refers to:
Assembly Language
Machine Code
ASSEMBLY LANGUAGE
• Few programmers ADVANTAGES
write programs in
• It requires less memory and execution
low level assembly
time
language, but it is
still used for • It allows hardware-specific complex jobs
developing code for in an easier way
specialist hardware,
such as device • It is suitable for time-critical jobs
drivers. • It is most suitable for writing interrupt
service routines and other memory
resident programs
MACHINE CODE
Programmers
rarely write in machine
code (binary) as it is
difficult to understand
and it can be
complicated to manage
data manipulation and
storage.
TRANSLATORS
• A program written in high-level
language is called as source code. To
convert the source code into
machine code, translators are
needed.
• A translator takes a program written
in source language as input and
converts it into a program in target
language as output.
• It also detects and reports the error
during translation.
COMPILERS
• Compilers are used to translate a program written in a high-level
language into machine code (object code).
• Once compiled (all in one go), the translated program file can then
be directly used by the computer and is independently executable.
• Compiling may take some time but the translated program can be
used again and again without the need for recompilation.
INTERPRETERS
• Interpreter is a translator which is used to convert programs
in high-level language to low-level language. Interpreter
translates line by line and reports the error once it
encountered during the translation process.
• It directly executes the operations specified in the source
program when the input is given by the user.
SI. No Compiler Interpreter
1 Performs the translation of a program as Performs statement by statement
a whole. translation.
2 Execution is faster. Execution is slower.
3 Requires more memory as linking is Memory usage is efficient as no
needed for the generated intermediate intermediate object code is generated.
object code.

4 Debugging is hard as the error messages It stops translation when the first error
are generated after scanning the entire is met. Hence, debugging is easy.
program only.

5 Programming languages like C, C++ uses Programming languages like Python,


compilers. BASIC, and Ruby uses interpreters.
ASSEMBLER
• Assembler is a translator which is used to translate the assembly
language code into machine language code so it can be used and
executed by the computer.
• Once assembled, the program file can be used again and again
without re-assembly.
Thank You

Vous aimerez peut-être aussi