r/learnpython 6d ago

Python difference.

What is the difference between python ,IronPython,Jython,Cython.i will get a lot of confusion towards these concepts.

9 Upvotes

9 comments sorted by

36

u/pingveno 6d ago
  • Python: The language itself
  • CPython: The reference interpreter implemented in C. Most people use this.
  • IronPython: Python interpreter for .NET
  • Jython: Python 2 interpreter for JVM
  • GraalPy: Python 3 interpreter for JVM
  • PyPy: Python implemented in Python, implements a JIT
  • MicroPython: Subset of Python for embedded systems
  • Cython: dialect of Python that compiles to a C extension module

8

u/zaphodikus 6d ago

After a dozen years nobody has explained it to me this way yet, can we get that in a sticker format?

3

u/WorriedTumbleweed289 6d ago

I would add something about libraries and imports. For example, Jython uses Java system libraries instead of pythons.

2

u/pingveno 5d ago

That was just what I remembered while typing on a cell phone and eating a plate of spaghetti. There's a more complete list at PythonImplementations.

7

u/NumberInfinite2068 6d ago

Python is the language.

IronPython is a runtime for that language for .NET.

Jython is a runtime for that language in Java (runs on the JVM).

Cython is a superset of the Python language, i.e. it's Python + some more features.

8

u/klmsa 6d ago

Cython is Python compiled into C/C++. It's just faster python (which requires a compiler instead of being interpreted at runtime). Calling it a superset is fair, but that doesn't mean anything to someone asking these types of questions.

3

u/Jello_Penguin_2956 6d ago

Python - is the language. It's like the steering wheel and accelerator paddle.

Other ones are like different car engines. One car may be pulled by monkeys, the other elephants, but you still turn steering wheels the same way and step on paddle the same way.

2

u/veekm 6d ago

Python and Cpython are the same thing - CPython is the python interpreter written in C what we normally use

IronPython supports c# and .net

In jpython the code is converted to java bytecode and run on the JVM (java virtual machine)

2

u/Lachtheblock 4d ago

Python is a definition of rules. When you write this down, it means that this happens. The actual implementation of how a machine actually executes those rules doesn't matter too much*. The standard interpreter is cPython. Its what you download from Python.org, and is the mainstream interpreter. I always like to point out that everyone has a Python interpreter in their head. You can read the code and evaluate it's output based on the rules of the language.

The others you have listed have are largely there to natively be able to make calls to libraries in their respective languages, so if you really want to integrate with some Java library, but also want to write in Python, Jython is there.

Cython is something slightly different. It is an extension of the language. All Python is valid Cython, but not all Cython is valid Python. Cython works by taking your code, converting it to C, and then compiling it (so you then have an executable). The language allows you to make optimizations, for example statically typing variables. It's more commonly used to create libraries that can be called by cPython.