Skip to main content

Python Interpreter - Difference between Compiler & Interpreter - Python Tutorials

In our series of Python tutorials previously we discussed about the Basics of Python and Installation of Python in video tutorials as well. Here in this part lets discuss about Python Interpreters.
Interpreter and Compiler:
            As a software developer, we use different types of programming languages such as C, C++, Java, Python depends upon our requirement. We all know that the programming languages which a human can understand are called as high-level programming language.
But:
The computer understands only machine learning, Hence it is needed to convert or translate the code into the machine language.
Interpreter and Compilers are used to convert the source code into the machine code.
What is an Interpreter?
The interpreter is nothing but a program which reads and executes the code. It includes different types of codes such as Source code, Compiler code. Most common interpreters available are Python, Ruby and PERL in which they execute their respective codes.
What is Python Interpreter?
Python Interpreter is same as we defined in Interpreter, It executes the respective Python codes.

Python Interpreter Architecture:


What is compiler?
Compiler is nothing but a program which translates the program written in a programming language to a code which the machine understands or machine language.
Compiler Architecture:



Phases of Compiler:



What is the difference between Compiler and Interpreter?

Interpreter
Compiler
Interpreter can able to translate one statement at a time.
Compiler works differently, It scans the whole program at first and translates it to the machine code.

Interpreter works faster in analyzing the source code of the program but ends up in slower overall execution time.
Compiler acts vice versa here, It takes more time to analyze the code but here you can expect faster execution time while comparing it with Interpreter.

Best part of Interpreter is it requires less memory because there is no need for intermediate object code.
Compiler needs an intermediate object code to be generated which lies in more memory requirement.
Debugging is easy here because interpreter bubbles up the error only after it met the first error.
As said in the first point, It scans the whole program, hence it generates the error report once the whole program is scanned. Thus the debugging part is hard.
Used by: Python, Ruby
Used by: C, C++

Points to Remember:

  • High level programming languages need to be translated into machine language.
  • Interpreter and Compilers are used to convert the source code into the machine code.
  • Most common interpreters are Python, Ruby and PERL
  • Interpreters are used by Python & Ruby
  • Compilers are used by C, C++



Source:
https://en.wikipedia.org/wiki/Interpreter_%28computing%29

Comments

  1. Thank you for sharing this useful information.

    C++ Training in Chennai | C++ Training

    ReplyDelete
  2. This looks absolutely perfect. All these tiny details are made with lot of background knowledge. I like it a lot. 

    DevOps Training in chennai

    DevOps Training in Bangalore

    ReplyDelete
  3. I always enjoy reading quality articles by an individual who is obviously knowledgeable on their chosen subject. Ill be watching this post with much interest. Keep up the great work, I will be back

    Tableau Training in Bangalore

    DevOps Training in Bangalore

    Tableau Training in Chennai

    Tableau Training in Bangalore

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete

Post a Comment

Popular posts from this blog

Python Basic Syntax

Introduction:  Python is most popular and high level programming language designed by Guido van Rossum in the year of 1991. You can use it to build web development, Game Development, Machine Learning Algorithm, etc and also You can even make robots using python.             Basic syntax of a python program is easy and simple than other programming languages.Python programs can be written using any text editor and should have the extension .py.             Before going further into Python syntax,I recommend you to read about the basics of Python . This Python Tutorial will explain about the basic syntax in Python with example programs. FREE PDF – Python course content. First Python Program:           Type the following content at the Python prompt and press the Enter:  print “Welcome”  The output will be  - Welcome Comments in Python:        ...

Basics of Python Language

What’s python? Python is an interpreted Composite programming language.  Python is an object-oriented, high-level programming language with dynamic semantics.  Which holds high-level built-in data structures, it is a combination of dynamic typing and dynamic binding, make it extremely attractive for Rapid Development of Application,  It is used for the scripting language to connect existing components together.  It is simple and easy to learn syntax emphasizes readability and for that reason reduces the cost of program maintenance. Check here the Latest Updated Python Course Content  Why do people use python? Python is a Simple and easy language for beginners because python can have a wonderful community to help all the needs. The language is also rapidly growing domain and broadly taught in universities and used for functioning with learner-friendly devices such as the Raspberry Pi Some quotable quotes “You really enjoy coding with Pytho...