[pypy-dev] refactoring Module discovery/implementation?

holger krekel hpk at trillke.net
Fri Sep 2 23:42:18 CEST 2005


Hi Armin, 

On Thu, Sep 01, 2005 at 11:41 +0200, Armin Rigo wrote:
> On Wed, Aug 31, 2005 at 08:45:04PM +0200, holger krekel wrote:
> > I'd like to suggest heading towards making PyPy's mixed
> > C-ported modules more self-contained and not have it's
> > implementation and initilization spread over several
> > directories and code areas.  
> 
> The 'thread' module is pretty much self-contained in this respect (I
> tried to keep it this way as much as possible), so I would like to hear
> more specifically what you think is still missing.  The structure is:
> 
>  pypy/module/thread/
>     __init__.py        interface
>     app_*.py           app-level stuff
>     os_*.py            interp-level stuff ('os' means using os threads)
>     test/              tests for the above
>     rpython/
>        exttable.py     table of external functions (guides both the
>                           annotator and the rtyper)
>        ll_thread.py    the low-level functions (similar to
>                           rpython/module/ll_*.py)
>        test/           rpython-level tests of external functions

That looks good indeed but we are not using similar structures
for most of the other mixed modules. Moreover, i am more interested
in the "runtime" interface and decoupling module implementations
from PyPy internals.  For example, we could import all module/X's at 
root level and query the package (or plain module, even) for all 
neccessary info like lldefs, annotation info for external 
functions, etc.  And the module files themselves should use a 
resonably stable and documented way to access the neccessary lltypes
and friends.  The idea is a bit to allow more people to work 
on porting C-modules conveniently and rather self-containedly
(with good error messages for annotations that conflict 
with provided info in the exttable for example). 

cheers, 

    holger



More information about the Pypy-dev mailing list