tags:

views:

439

answers:

6

I am relatively new to Python, and I have always used the standard cpython (v2.5) implementation.

I've been wondering about the other implementations though, particularly Jython and IronPython. What makes them better? What makes them worse? What other implementations are there?

I guess what I'm looking for is a summary and list of pros and cons for each implementation.

+1  A: 

Pros: Access to the libraries available for JVM or CLR.

Cons: Both naturally lag behind CPython in terms of features.

Antti Rasinen
+11  A: 

Jython and IronPython are useful if you have an overriding need to interface with existing libraries written in a different platform, like if you have 100,000 lines of Java and you just want to write a 20-line Python script. Not particularly useful for anything else, in my opinion, because they are perpetually a few versions behind CPython due to community inertia.

Stackless is interesting because it has support for green threads, continuations, etc. Sort of an Erlang-lite.

PyPy is an experimental interpreter/compiler that may one day supplant CPython, but for now is more of a testbed for new ideas.

John Millikin
Some of the magic for Stackless (green threads, etc.) is available for the CPython implementation in the py.magic library, which was developed by PyPy.As far as I know, stackless developed is somewhat quieted, most of the work for the Erlang-lite features is now going into PyPy.
Ryan
+1  A: 

All of the implementations are listed here:

http://www.python.org/dev/implementations/

CPython is the "reference implementation" and developed by Guido and the core developers.

Corey Goldberg
+1  A: 

IronPython and Jython use the runtime environment for .NET or Java and with that comes Just In Time compilation and a garbage collector different from the original CPython. They might be also faster than CPython thanks to the JIT, but I don't know that for sure.

A downside in using Jython or IronPython is that you cannot use native C modules, they can be only used in CPython.

Roman Plášil
+1  A: 

PyPy is a Python implementation written in RPython wich is a Python subset.

RPython can be translated to run on a VM or, unlike standard Python, RPython can be statically compiled.

Pierre-Jean Coudert
+3  A: 

An additional benefit for Jython, at least for some, is it lacks the GIL (the Global Interpreter Lock) and uses Java's native threads. This means that you can run pure Python code in parallel, something not possible with the GIL.

Martin W
Same with IronPython!
Jason Baker