[pypy-dev] Object model

Armin Rigo arigo at tunes.org
Sat Feb 15 10:36:26 CET 2003


Hello Rocco,

Mmh, my previous e-mail was quite lengthy.  Sorry for that, I guess I was
thinking aloud...

I was seduced in the first place by the symmetry and generality of
wrap()/unwrap() (whose name came from the already-cited paper
"Representing Type Information in Dynamically Typed Languages",
http://citeseer.nj.nec.com/gudeman93representing.html).

One of the problems with wrap()/unwrap() is when they are applied to
containers.  As they are, they have to "translate" the whole structure
recursively, which is often not a good idea.

On the other hand, if we define more specialized purpose-oriented methods, we
loose opportunities given by wrap()/unwrap() to let particular routines send
or examine an arbitrary piece of data.  I'm thinking about type-based
dispatch, for example, where you have to query the type of an object with the
appropriate ObjectSpace method, and then unwrap() this type.

I don't know which one is better.  Maybe both are useful.  I guess we will
have to try and see.  Hopefully, trying both should be easy in the early
phases.


A bientôt,

Armin.



More information about the Pypy-dev mailing list