How to port Python code into C++ code automatically?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Thu Mar 13 04:06:10 EDT 2008


On Wed, 12 Mar 2008 20:15:32 -0700, Bo wrote:

> I want to port a Python project (about 10,000 line python code) to C+
> +. Is there any automatically tool to do this kind of things? e.g.,
> SWIG(http://www.swig.org/)?
> 
> Any comment is welcome!

Have a look at the ShedSkin Python-to-C++ compiler:

  http://shed-skin.blogspot.com/

It has some restrictions, i.e. the code has to be written in a more or
less statically typed way.

And me too is interested in why you want to port the entire project instead
just the time critical parts?  ShedSkin might help here too.  As Cython_
or Pyrex_ do.  Both compile a subset of Python with optional static typing
to C extension modules.

.. _Cython: http://www.cython.org/
.. _Pyrex: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list