Difference between various Implementations of Python?


Most developers know about python, irrespective of what python is implemented in their system. Therefore, what do I mean by “python”, is it a python the abstract interface? Do we mean CPython, the common Python implementation (not the Cython)?. Or we mean something else entirely? Or we mean Jython or IronPython or PyPy.

While the technologies mentioned above are commonly-named and commonly-referenced, however some of them serve completely different purposes.

We can think of python as a specification for a language that can be implemented in many different ways.

In this tutorial we’ll go through the following implementation of python −

  • CPython
  • IronPython
  • Jython
  • PyPy

CPython

CPython is the implementation of the language called “Python” in C. Python is an interpreted programming language. Hence, Python programmers need interpreters to convert Python code into machine code. Whereas Cython is a compiled programming language. The Cython programs can be executed directly by the CPU of the underlying computer without using any interpreter.

IronPython

IronPython is an open-source implementation of the Python programming language which is tightly integrated with .NET. IronPython can use .NET and Python libraries, and other .NET languages can use Python code just as easily.

The IronPython implementation uses .Net Virtual Machine i.e Common Language Runtime. It is written in c#. IronPython uses the .NET framework and through this .NET languages can easily and efficiently use the Python code.

The existing .NET developers can also use IronPython as a fast and expressive scripting language for embedding, testing, or writing a new application from scratch.

Jython

Jython, as the name suggests is an implementation of Python that can run on the Java platform. The Jython project provides implementations of Python in Java, providing to Python the benefits of running on the JVM and access to classes written in Java. Jython is slow as compared to Cpython. Jython implementations are freely available for both commercial and non-commercial use.

Jython provides an interactive interpreter that can be used to interact with Java packages or with running Java applications.

PyPy

PyPy is an implementation of the Python programming language written in Python. The Interpreter is written in RPython. The RPython is itself a subset of Python). On average, PyPy is 4.5 times faster than CPython.

PyPy is highly compatible with existing python code. It supports cffi, cppyy, and can run popular python libraries like twisted, and django. It can also run NumPy, Scikit-learn and more via a cextension compatibility layer.

Updated on: 12-Aug-2022

145 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements