[pypy-dev] Mixed modules for both PyPy and CPython

holger krekel hpk at trillke.net
Sat Apr 15 15:58:09 CEST 2006


Hi Armin, 

On Sat, Apr 15, 2006 at 15:09 +0200, Armin Rigo wrote:
> On Fri, Apr 14, 2006 at 07:44:12PM +0200, holger krekel wrote:
> > Hum, i wonder how strongly opposed these explicit versus implicit
> > level separation models need to be.
> 
> Yes, you're right here.  It's mostly about what we need to do next: we
> must choose one of the two models and develop it enough, until it
> becomes useful for PyPy and CPython alike.  We could possibly do both
> models in parallel, but I'm not sure it's the best way forward at this
> point.
> 
> > Is it not possible to support a 
> > programming model that can mostly avoid knowing about interpreter versus 
> > application level distinction without extending/refactoring the annotator?
> 
> Sure, no-one thinks about refactoring the annotator.  The implicit model
> already works, by using the existing support for SomeObjects, completed
> by Christian over the time.  It's a bit hackish, though, and we'll
> definitely need ways to control where SomeObjects are expected or not.
> At the moment, what makes me reluctant to continue with the implicit
> model are two other issues: on the one hand, it's unclear how it would
> work for PyPy (it works for CPython only); and there are many language
> design issues ahead that I'd rather avoid for the time being.

I agree but may have a somewhat different idea in mind when 
talking about a more implicit model: namely assuming that all objects live 
within the current RPython model (no SomeObject's whatsoever) and providing 
explicit interactions (like gateway.interp2app), exposing of type definitions
etc. 

> > "explicit" approach nicely working before experimenting with where 
> > we can go from there, right?
> 
> Yes, exactly my opinion.
> 
> > (Btw, i wouldn't
> > mind if such glue code would not allow all possible interactions - 
> > our primary goal is not to provide seemless integration with CPython here).
> 
> I'm not too worried about this.  Our mixed-module model already supports
> mostly any kind of interaction, including defining new types with
> properties and overridden operations.  The path to support the same for
> CPython extension modules is more or less clear, and very incremental.

Yes, the mixed modules (and interpreter/gateway's, typedef's) support
interaction but by rather explicitely programming the machinery. 
With "glue code" i mean code where the user does not need to
know about such machinery so much.  IOW, the question is 
which implicit models (as seen from the ext module programmer) 
are possible without having SomeObjects around? 

    holger



More information about the Pypy-dev mailing list