[pypy-dev] is there incremental building for the translator?

Philip Guo pg at cs.stanford.edu
Wed Oct 7 01:49:31 CEST 2009

As a general rule, should I be trying to implement my PyPy extensions as new
object spaces (e.g., like the thunk object space)?

For the first draft of my hacked interpreter, I just made changes all
throughout the core PyPy interpreter codebase, which worked fine when I was
running in interpreted mode (py.py), but as soon as I tried to translate to
create pypy-c, understandable all hell broke loose and translation
mysteriously failed.  I'm pretty sure that some of my hacks screwed
something up.

The thing is, I want to hack some changes to affect control flow, and I
don't know how to do that with an object space.  In particular, I want to
alter control flow so that some function calls execute normally but other
ones don't actually execute the function call but rather use a memoized
return value that I previously saved.  It's fairly straightforward to do by
hacking PyPy interpreter directly, but I can't think of an easy way to do it
with a separate object space.

Any tips would be greatly appreciated.


On Tue, Oct 6, 2009 at 1:54 PM, Philip Guo <pg at cs.stanford.edu> wrote:

> sounds great, thanks for all the suggestions!
> On Tue, Oct 6, 2009 at 1:51 PM, Maciej Fijalkowski <fijall at gmail.com>wrote:
>> Also, our workflow is to test stuff on top of CPython first, so you
>> don't have to recompile very often (sometimes not at all).
>> Cheers,
>> fijal
>> On Tue, Oct 6, 2009 at 2:23 PM, Benjamin Peterson <benjamin at python.org>
>> wrote:
>> > 2009/10/6 Philip Guo <pg at cs.stanford.edu>:
>> >> Hi all,
>> >>
>> >> Sorry for another newbie question, but I'm wondering whether there is
>> any
>> >> sort of "Makefile"-like incremental building functionality for the PyPy
>> >> translator.  I just ran:
>> >>
>> >> cd pypy/translator/goal
>> >> python translate.py --opt=3 targetpypystandalone.py
>> >>
>> >> to create pypy-c, which works perfectly, but it took about an hour on
>> my
>> >> machine.  If I start hacking the PyPy source code, it seems like I have
>> to
>> >> do the full translation step each time I want to create a new pypy-c.
>> Is
>> >> there any way around this?
>> >
>> > No, because if you make a change then the whole program has to
>> > retranslated to maintian invariants. What you can do, though, is speed
>> > up the translation process by turning off optimization and using
>> > --no-allworkingmodules.
>> >
>> >
>> > --
>> > Regards,
>> > Benjamin
>> > _______________________________________________
>> > pypy-dev at codespeak.net
>> > http://codespeak.net/mailman/listinfo/pypy-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20091006/06a6575c/attachment.html>

More information about the Pypy-dev mailing list