[pypy-dev] PyPy to generate C/C++ code

Saravanan Shanmugham sarvi at yahoo.com
Tue Sep 14 21:32:27 CEST 2010

To be very clear this is not a question on PyPY RPython itself. :-))

But I had another thought and wanted to run it by PyPy team. 

As I understand it PyPy is foremost a language development framework. 
It is about implementing the python interpreter in RPython, plus 
additional hints to assist in JIT generation. 

If the Python language implementation in RPython has enough 
information to create a python interpreter and do JIT compilation. 
I am thinking it should have enough information to generate C/C++ code.

The kind that shedskin has under shedskin/lib/ 

Basically port the type inference engine from shedskin over to PyPy and use the 
bulk of Shedksin C++ code but use PyPy Language 
Framework to implement the Python Compiler that shedksin implements? 

In otherwords, can PyPy be the language framework in which Shedskin is 
implemented/ported onto?

Looking Shedskin and PyPy do yall have a rough feel for how difficult this would 

Why the question?
I am planning to fund some prize money for an Under/Graduate school project back 
in India and am looking for ideas. 

This means we would able to motivate a team of 2-5 smart young engineers for 
about 6 months into doing something interesting for them but  beneficial for the 
python community. 

One area I am obviously looking at is compiling Python code. 

I was thinking the project could be to 
   1. take your C++ code under shedskin/lib as is 
   2. Have them implement/port the shedskin type inference engine onto the PyPy 
framework and create a PyPy backend that generates  the C++ code 
from the shedskin/lib 

What would yall think of such an idea. 
Estimates? Feasibility? 
Do you see any benefits to this work for Shedskin or PyPy or both? 



More information about the Pypy-dev mailing list