[pypy-dev] Who's developing language interpreters in PyPy
Robert Schmitt
rschmitt at medcom-online.de
Tue Apr 24 11:29:59 CEST 2007
Carl Friedrich Bolz schrieb:
> To be honest, I don't see how a C-to-Python-compiler a) relates to PyPy
> and b) why it would be useful. What real benefit do you see there?
Such a module would not have to be part of pypy, but it could make quite
good use of the machinery already in place.
> Interfacing to C/C++ code is not that hard in CPython, and PyPy is
> getting there too. Such a compiler would also be quite hard, since C/C++
> allow all sorts of crazy unsafe things, so you would end up doing
> something like described in the paper "Complete Translation of Unsafe
> Native Code to Safe Bytecode" by Brian Alliet and Adam Megacz.
There certainly is a way to access python from C/C++ and vice versa, so
that is not my concern. But going one step further would be really
beneficial: Getting legacy C code to a platform where it can be
used, test-infected, and refactored, that would be cool.
On the other hand, I totally agree with you that it would be quite a
crazy endeavor - then again, what's life without a challenge :-)
Taking the approach of the paper would probably be easier than
translating the source, but I don't see a benefit unless you use
the symbolic intermediate data generated by the compiler so you can
generate readable code in the end - or do I misunderstand the pypy
architecture, can't you generate rpython output with it?
More information about the Pypy-dev
mailing list