Saturday, April 24, 2010

Python in Python.

Every python dev sooner or later found out about other python implementations. Python (as language) have them plenty: Jython, IronPython, PyPy, to name a few. They are all very important and adds to spirit of python community. To emphasize it Guido van Rossum have proposed suspension of changes to python syntax, semantic, and build-ins. So non c implementations can catch up with recent changes (mainly emerging py3k).

Jython or IronPython are great at combing python in java or .Net but the most exciting is PyPy the idea to write python in python. 


PyPy have many advantages over CPython:
  • Speed
  • Memory usage
  • JIT compiler
  • Sandboxing
  • 'Stackless' as option
  • .Net and Java backends
  • other languages backends (Prolog, Smalltalk, JavaScript, Io, Scheme, Gamboy)
PyPy can be really faster up to 28%.
PyPy implementation of classes and objects is economic and comparing to cpython apps that eat hundreds of MBs should consume less up to 50%.
PyPy JIT compiler is responsible for speed. It allow to translate python into java, prolog, it also help in memory management.
Stackless can use micro-threads.
And there are ready to use Java and .Net back ends Prolog is almost complete and others are developed.

PyPy 1.2 is compilant with CPython 2.5. You can already use some great third-party packages like Django, Pylons, Twisted or Pyglet.

To sum up PyPy is really worth trying, promising Python implementation.

No comments:

Post a Comment