Fwd: Work plan for PyPy

Hi Richard, On Wed, Jun 27, 2007 at 01:55:13PM -0700, Richard Emslie wrote:
Precisely, by contrast I'm thinking about having lower level stub functions that are generated automatically from the lltype declarations. For example, an external ll function ptr would generate a simple stub, always the same. GenC and GenLLVM would share the code to produce the stubs. Similarly, getting at an external variable (or variable-like macro) like errno should be expressable in an lltype way (it's not right now) that gets turned into """int _rpyget_errno(void) { return errno; }""".
Generating c code in llvm backend would sort of defeat the point of it IMHO.
The difference is that the stubs would always be generated from simple templates, not from genc's complex logic that turns flow graphs into C code. A bientot, Armin.

Hi Armin, On Jun 28, 2007, at 4:15 AM, Armin Rigo wrote:
Ok - cool. I was hoping to propose something along these lines - but was unsure how to go about it. This would be ideal and work great for backends. I am guessing all memory management with this would be explicitly controlled from outside the stubs?
Yeah - this sounds fantastic. No clue how to do it - but great! :-) Well - I'm in the process of migrating back home... again. Once i get back though I can devote lots of time to this. I doubt i can make the sprint, but will try. Cheers, Richard

Hi Maciek, On Sat, Jun 30, 2007 at 01:12:57PM +0200, Maciek Fijalkowski wrote:
Just a little correction - you can express c-level constant in lltype. There is CConstant class for that.
True, although I'm not sure it works for non-integer constants (e.g. static data). Also, I suppose that it could be abused to represent "errno" but it looks fragile. A bientot, Armin.

Hi Richard, On Wed, Jun 27, 2007 at 01:55:13PM -0700, Richard Emslie wrote:
Precisely, by contrast I'm thinking about having lower level stub functions that are generated automatically from the lltype declarations. For example, an external ll function ptr would generate a simple stub, always the same. GenC and GenLLVM would share the code to produce the stubs. Similarly, getting at an external variable (or variable-like macro) like errno should be expressable in an lltype way (it's not right now) that gets turned into """int _rpyget_errno(void) { return errno; }""".
Generating c code in llvm backend would sort of defeat the point of it IMHO.
The difference is that the stubs would always be generated from simple templates, not from genc's complex logic that turns flow graphs into C code. A bientot, Armin.

Hi Armin, On Jun 28, 2007, at 4:15 AM, Armin Rigo wrote:
Ok - cool. I was hoping to propose something along these lines - but was unsure how to go about it. This would be ideal and work great for backends. I am guessing all memory management with this would be explicitly controlled from outside the stubs?
Yeah - this sounds fantastic. No clue how to do it - but great! :-) Well - I'm in the process of migrating back home... again. Once i get back though I can devote lots of time to this. I doubt i can make the sprint, but will try. Cheers, Richard

Hi Maciek, On Sat, Jun 30, 2007 at 01:12:57PM +0200, Maciek Fijalkowski wrote:
Just a little correction - you can express c-level constant in lltype. There is CConstant class for that.
True, although I'm not sure it works for non-integer constants (e.g. static data). Also, I suppose that it could be abused to represent "errno" but it looks fragile. A bientot, Armin.
participants (3)
-
Armin Rigo
-
Maciek Fijalkowski
-
Richard Emslie