[pypy-dev] Advice on Compiling Pypy-c for debugging (Stackless support)

Andrew Francis andrewfr_ice at yahoo.com
Sun Nov 14 16:11:32 CET 2010


Hello Leonardo:

--- On Sat, 11/13/10, Leonardo Santagada <santagada at gmail.com> wrote:

> From: Leonardo Santagada <santagada at gmail.com>
> Subject: Re: [pypy-dev] Advice on Compiling Pypy-c for debugging (Stackless support)
> To: "Andrew Francis" <andrewfr_ice at yahoo.com>
> Cc: pypy-dev at codespeak.net
> Date: Saturday, November 13, 2010, 10:38 AM
> On Sat, Nov 13, 2010 at 3:40 PM,
> Andrew Francis <andrewfr_ice at yahoo.com>
> wrote:
> > --- On Sat, 11/13/10, Leonardo Santagada <santagada at gmail.com>
> wrote:

> I think what fijal meant is to use the ideas in greenlets.c
> and map them to pypy, but not directly trying to run the extension
> on top of pypy.

I understood what Fijal said. I thought why not try modifying it?

> Here is a list of what is crazy about the idea:
> - greenlets is a c module, but the stuff it does with the
> stack is completely outside the C API which is what pypy supports
> from cpython.

Leonardo, I don't want to sound argumentative but conceptually does this differ from what greenlets does with Standard Python? If I am not mistaken, greenlets (like Stackless Python) at some point need to do some very machine dependent low-level stuff to move  stack frames to and from a heap. That is not in the C API either. 

> - It will (probably) break the gc. It will not find the
> roots (address on the stack to memory on the heap) from functions that >are taken out of the stack - The layout of the stack is probably not the >same also and that will also break.

I acknowledge all of these concerns. However what I would like to figure out is if the greenlet.c code is sufficiently modular so these parts can be isolated. I figure it would be good strategy to try to keep most of greenlet's high level 

Maybe folks can take a quick look at greenlet.c and off-hand state what would change. I would figure that low level routines (i.e., like g_save() and slp_restore_state(). In this fashion we have more facts to see if this approach should be nipped in the bud. 

> - To translate faster and using less memory turn your
> python to 32bit and use --no-allworkingmodules.

Great! I'll try this.

> - Look at how greenlets.c work and talk

I am doing this as we speak. I'll make IRC appearances once I have really has something new to add. 

> ps: I hope I was clear (and also correct)

I thank you for your input. Right now, I need more information and to learn more. 

Cheers,
Andrew





      



More information about the Pypy-dev mailing list