[pypy-dev] Builtin types

Thomas Heller theller at python.net
Fri Jan 24 12:10:22 CET 2003

Bengt Richter <bokr at oz.net> writes:

[description of ctypes internal deleted]
> It does sound like a lot of similar ground is covered. Are your
> offset and size values in bits or bytes? (I intended bits).

Currently they measure in bytes, but only because I didn't have
a need for bit fields in structs or unions.

> The thing I think would be cool is if one could write python to
> build meta_repr objects in python and have Psyco compile Python code
> manipulating those representations and wind up with machine code
> effectively equivalent to what the C code in your ctypes module does
> when given the same implicit abstract info defining fields and
> accessors etc., and code using those.
> The thing about the latter situation is that Psyco would still see
> code accessing a foreign interface to getfunc/setfunc, whereas if it
> sees Python code actually accessing the data meta-representations
> behind getfunc/setfunc, it has a chance to bypass function calls and
> generate inline machine code instead of using your canned
> functions. Probably a loss at first, but eventually it could be a
> gain, depending on Psyco?

Maybe. We'll see ;-)
All great ideas in the air!


More information about the Pypy-dev mailing list