[pypy-dev] Re: Base Object library (was: stdobjspace status)

Armin Rigo arigo at tunes.org
Thu Feb 27 16:53:46 CET 2003


Hello Stephan, hello Laura,

Thanks Laura for pointing out the potential language problems.

Your point of view on Compliant Object Spaces is very helpful.  It seems to
show that we will want different object spaces that share quite a lot of
source files, e.g. two object spaces which are the same except for their list
implementation.  Moreover, some of these implementations might be easier to 
translate into efficient C code and some others might be better suited for 
translation to some other language.

What we may thus need is a way to define several object spaces from the same
set of files.  The std/ directory would then contain all files that implement
a bit of the "compliant" behavior for some specific kind of objects; it could
contain e.g. both the standard and Stephan's decimal implementation of floats.  
What is left to be determined is thus how the objects are instantiated, as
Stephan pointed out.  This currently takes place in the class ObjSpace, in the
methods wrap(), newlist(), newtuple(), newdict(), etc.  Then what we will need
at some point is to have several different subclasses of baseobjspace.ObjSpace
in several files, possibly all inside std/, which import and instanciate
different W_XxxObject classes.  To make an object space which is the same as
another one expect for its implementation of floats, just override its wrap()  
method.

Sounds cool!


A bientôt,

Armin.


More information about the Pypy-dev mailing list