Successfully reported this slideshow.

Compiler vs Interpreter-Compiler design ppt.

8,317 views

Published on

Compiler vs Interpreter-Compiler design ppt.

Published in: Engineering
  • it's very usefull ppt in this webside
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Compiler vs Interpreter-Compiler design ppt.

  1. 1. Welcome to our Presentation Topic : COMPILER vs INTERPRETER.
  2. 2. Group Name: Gravity Group Member: Md. Alamgir Hossen Id:121-15-1761 Md. Abdus Sami Id:121-15-1712 Animesh Bhattacharjee Id:121-15-1680 Mushfiqur Rahman Id:121-16-1793
  3. 3. What is Compiler? Compiler: A compiler is a piece of code that translates the high level language into machine language. When a user writes a code in a high level language such as Java and wants it to execute, a specific compiler which is designed for Java is used before it will be executed. The compiler scans the entire program first and then translates it into machine code which will be executed by the computer processor and the corresponding tasks will be performed. Shown in the figure is basic outline of the compilation process, here program written in higher level language is known as source program and the converted one is called object program.
  4. 4. Compiler working Process
  5. 5. Compiler code  Here is a compiler code example that run “HELLO WORD”  If you create any error in code then out not found or get error message.
  6. 6. What is interpreter? Interpreters: Interpreters are not much different than compilers. They also convert the high level language into machine readable binary equivalents. Each time when an interpreter gets a high level language code to be executed, it converts the code into an intermediate code before converting it into the machine code. Each part of the code is interpreted and then execute separately in a sequence and an error is found in a part of the code it will stop the interpretation of the code without translating the next set of the codes. Outlining the basic working of the interpreter the above figure shows that first a source code is converted to an intermediate form and then that is executed by the interpreter.
  7. 7. Interpreter Code Example
  8. 8. Interpret Working Process
  9. 9. COMPILER vs INTERPRETER A Compiler and Interpreter both carry out the same purpose – convert a high level language (like C, Java) instructions into the binary form which is understandable by computer hardware. They are the software used to execute the high level programs and codes to perform various tasks. Specific compilers/interpreters are designed for different high level languages. However both compiler and interpreter have the same objective but they differ in the way they accomplish their task i.e. convert high level language into machine language. Through this article we will talk about the basic working of both and distinguish the basic difference between compiler and interpreter. Before going through differences, keep in mind the following technical terms.
  10. 10. COMPILER vs INTERPRETER Compile time: – The time taken to compile a program. Run time: – The time taken for executing a program. Source code: - The program in its user written form of the language. Source code is given as input to the compiler. Object code: - Is actually the machine code which is obtained by converting source code. The computer can read and execute machine code directly. An object code is also known as binary code / machine code.
  11. 11. COMPILER vs INTERPRETER So the primary difference between a compiler and interpreter is in the way a program is executed. Any one serious about programming should understand the working of compilers, interpreters and the differences between them. So here trying to outline generic differences between compiling and interpreting (compilers vs interpreters).
  12. 12. Short Different
  13. 13. Advantages of using compiler  Since compiler converts the program to native code of the target machine (object code), faster performance can be expected.  There is a scope for code optimization.
  14. 14. Advantages of using interpreter  Process of execution can be done in a single stage. There is no need of a compilation stage.  Alteration of codes possible during runtime.  Really useful for debugging the codes (because source code execution can be analyzed in an IDE)  Facilitates interactive code development.
  15. 15. That’s all Any Question
  16. 16. Thanks to All for staying with us.

×