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

Benjamin Peterson benjamin at python.org
Wed Oct 7 01:56:51 CEST 2009

2009/10/6 Philip Guo <pg at cs.stanford.edu>:
> 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.

Well, no matter where you implement your changes, it will probably not
translate. :)

> 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.

Usually control changes have to be implemented in the interpreter
since they consistute a change in the language. The objspace is
primarily useful for changing object behavior.

> Any tips would be greatly appreciated.
> Thanks!
> Philip


More information about the Pypy-dev mailing list