0% found this document useful (0 votes)
10 views5 pages

Language Translators

The document discusses language translators, specifically assemblers, compilers, and interpreters, outlining their functions and differences. It highlights the benefits and drawbacks of using compilers, which produce executable files but require recompilation for changes, and interpreters, which allow for immediate error correction but do not create executable files. Additionally, it describes features of Integrated Development Environments (IDEs) that aid programmers in writing and debugging code.

Uploaded by

Ariyan Islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views5 pages

Language Translators

The document discusses language translators, specifically assemblers, compilers, and interpreters, outlining their functions and differences. It highlights the benefits and drawbacks of using compilers, which produce executable files but require recompilation for changes, and interpreters, which allow for immediate error correction but do not create executable files. Additionally, it describes features of Integrated Development Environments (IDEs) that aid programmers in writing and debugging code.

Uploaded by

Ariyan Islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Language translators:

• assembler software for the translation of an assembly language program:

 Programs written in assembly language is translated into machine code by the assembler.
 Each instruction in the source code consists of opcode and operand.
 The software translates low level language into machine code for the processor to execute.
 The source code uses instructions from the processor’s instruction set.
 Explain the benefits and drawbacks of using either a
 compiler or interpreter and justify the use of each

Explain the benefits and drawbacks of using either a compiler or interpreter and justify the use of
each

• a compiler for the translation of a high-level language program:

 Compiler translates high level language into machine code for the processor to execute.
 Compiler executes an executable file.
 No need to give access to source code so makes it more difficult for the user to modify the code.
Benefits of compiler:
 produces an executable file.
 User does not have access to source code.
 It will probably be faster to run the executable file.
 Code does not have to compiled each time it is executed.
 Does not need the compiler to be present at runtime.

Drawbacks of compiler:

 The source code must be re compiled every time the programmer changes the program.
 Finding errors is difficult as error messages are given at the end.
 The source code must be 100% correct for executable file to be produced.

• an interpreter for translation and execution of a high-level language program:

 interpreter translates high level language into machine code for the processor to execute line by
line.
 Th interpreter reads each statement and checks it before running it.
 The interpreter halts when it encounters an error.
 The interpreter analyses and checks each line before executing it.

Benefits of interpreter:

 Errors can be corrected as they occur.


 Can run a partially complete program when developing.
 The effect of any change made to the code can be seen immediately.

Drawbacks of interpreter:

 No executable file is produced.


 User has access to source code.
 Need to translate the source code again and again so consumes time.
 An interpreter should be present at the time of execution.

Differences between compiler and interpreter:

 Compilers create an executable file. Interpreter does not create executable files.
 The compiled program can be independently distributed but interpreted program cannot be
executed without interpreter.
 The interpreter executes each statement immediately after decoding. Compiler checks the
whole program for errors.
 The interpreter software must be present in main memory every time the program is executed.
The compiled program does not require a compiler.
 Cross compilation is possible (compile on one hardware to run on another)
 See the table from hooder books page:152

Show awareness that high-level language programs may be partially compiled and partially
interpreted, such as Java (console mode):

 to achieve shorter execution times, many high-level languages programs


use a system that is partial compilation and partially interpretation.
 The source code is checked and translated by a compiler into object code.
 The compiled object code is a low-level machine independent code, called
intermediate code, p-code or bytecode.
 To execute the program, the object code can be interpreted by an
interpreter or compiled using a compiler.
 For example, Java and Python programs can be translated by a compiler
into a set of instructions for a virtual machine. These instructions, called
bytecode, are then interpreted by an interpreter.
 Describe features found in a typical Integrated Development Environment (IDE) Including:

An integrated development environment (IDE) is used by programmers to aid


the writing and development of programs. There are many different IDEs
available; some just support one programming language, others can be used
for several different programming languages. NetBeans®, PyCharm®.
Features of IDE:
 a source code editor (for coding, including context-sensitive prompts, dynamic syntax
checking, pretty printing, (for initial error detection.), break and expand code blocks):
 for debugging, including single stepping, breakpoints, i.e. variables, expressions, report window
o allows program to be written and edited without the need to use a separate text editor.
o Lay out the program in a meaningful way (pretty printing).
o Offer context sensitive prompts with text completion for variable names and reserved
words.
o Provide dynamic syntax checking.
o Find possible syntax error as program is being typed.
o Logical error only be found after seeing the output.
o Larger program can have more than one code block. some code blocks can be
collapsed to a single line in the editor allowing the programmer to just
see the code blocks that are currently being developed.
 a compiler, an interpreter, or both.:
o used to produce final version of object code.
o Run time environment provided to show the output.
 a run-time environment with a debugger. (For debugging, including single
stepping, breakpoints, i.e. variables, expressions, report window:

o A debugger is a program that runs the program under development


and aids the process of debugging.
o It allows the programmer to single step through the program a line at a
time (single stepping) or to set a breakpoint to stop the execution of
the program at a certain point in the source code.
o A report window then shows the contents of the variables and
expressions evaluated at that point in the program. This allows the
programmer to see if there are any logic errors in the program and
check that the program works as intended.
 an auto-documenter.
o

You might also like