[pypy-dev] How to translate 300000 lines of C

holger krekel hpk at trillke.net
Tue Jan 21 16:05:04 CET 2003


[Armin Rigo Tue, Jan 21, 2003 at 03:41:29PM +0100]
> Hello Holger,
> 
> On Tue, Jan 21, 2003 at 03:17:05PM +0100, holger krekel wrote:
> > > What I think is needed is a tool, that does the
> > > translation partially automatically, partially
> > > on my command, with some scripted rules.
> > 
> > *This* still seems like a nightmare to me. you
> > have the complexity for both developments (CPython
> > and PyPython) and the added complexity of syncing
> > them.  Unless your C-to-python translation is 
> > fully automatic. 
> 
> I would say the goal is to completely automate this translation --- not in the
> sense that we have The Ultimate C-to-Python Translator(tm), but in the sense
> that all hints and special cases have to be described in custom .py files
> attached to the .c sources.  "Regular" non-special-case'd changes to the 
> CPython source come "for free" into MiniPy.

Sounds nice but i am not convinced this is doable in a simple
way.  But simplicity should be a major goal.  It's to me what
made and makes python a success. 

> > Note, that taking the 'pythonic code as primary 
> > ressource' route wasn't possible for the Jython
> > people at the time.  And they have a hard time
> > catching up. 
> 
> Both Jython and the old Stackless demonstrate badly enough that translating
> the CPython code manually might be quite possible, but if you do it, your
> project is doomed to become completely out-of-date after a couple of years.  
> Let's not repeat that mistake.

Wait a moment.

My implicit point here was that it's hardly possible to 
convince CPython-dev people to prototype or implement 
at Java-level. 

But it is common python-dev practice already to prototype new 
stuff in Python and if the interface is stable and clean 
port it to CPython to make it faster.  Now if PyPython
helps with the speed problem then the incentive
to have a CPython version is lower.  Even more so, 
if you can generate CPython-sources from the python 
version.  I wouldn't mind requiring hints for a special
Python-to-CPython generator.

cheers,

    holger


More information about the Pypy-dev mailing list