[pypy-dev] refactoring Module discovery/implementation?

holger krekel hpk at trillke.net
Wed Aug 31 20:45:04 CEST 2005

Hi pypy-dev, 

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.  

IMO it's good that CPython has basically one C file that describes 
a Module's implementation.  With Python we could make it a package 
so that we can still separate information like interp-level, 
app-level and low-level glue code but keep things more together
and have it picked up via some more plugin-based scheme. 

The package scheme (probably based on the current mixed modules
approach) should have a runtime interface and try to 
stay indepedent from the inner PyPy developments like where
exactly things at low level are located.   

With "runtime interface" i mean that PyPy would automatically
discover all modules in a given plugin/module directory 
by importing and querying them to get information 
the provided module, a description (docstring) and 
e.g. which ll-functions are provided and special
annotations and what not. 

Oh, and "py.py --listmodules" should provide a full view 
of available modules (and modules included by the current 
defaults) so that you can pass that to --usemodules="x,y,z". 

This involves a bit of API design that we haven't done much 
for our internal stuff yet but i think it's about time to provide
some nicer APIs and separate things.

What do you think?  A sprint topic?   
First write documentation and then implement?  



More information about the Pypy-dev mailing list