[pypy-dev] Builtin types
Darius Bacon
darius at accesscom.com
Fri Jan 24 07:36:42 CET 2003
Bengt Richter <bokr at oz.net> writes:
> I have some thoughts for decribing C structures (and anything else
> digital) in a canonical abstract way. I'll call such a decription
> a meta-representation, and a function that produces it from a Python
> object is meta_repr(python_object) => meta_rep_obj. The reverse
> operation is meta_eval ;-)
>
> The basis for meta_repr is that it capture and meta-represent
> (type, id, value) for an object in a pure abstract form.
> The abstract basis for storing the information is a bitvector
> object with attribute names that specify slices of the bitvector.
> I.e., there is an effective dict like {'slicename':(lo,hi)} and
> __getattr__ uses it so that bvec.slicename refers to bvec[lo:hi] etc.
> This is pure and abstract data, but you can see that interpreted
> little-endianly you can very straightforwardly lay out a C struct
> with whatever field widths and alignments you want.
Sounds vaguely like this paper:
First-Class Data-type Representation in SchemeXerox
http://citeseer.nj.nec.com/4990.html
Darius
More information about the Pypy-dev
mailing list