[pypy-dev] rffi feature request
simon at arrowtheory.com
Wed Aug 8 18:14:40 CEST 2007
On Tue, 07 Aug 2007 14:15:48 +0200
Maciek Fijalkowski <fijal at genesilico.pl> wrote:
> Simon Burton wrote:
> > On Fri, 3 Aug 2007 12:14:13 -0700
> > Simon Burton <simon at arrowtheory.com> wrote:
> >> I would like to expose some functions as external
> >> symbols when i build a .so
> >> def foo(i, j):
> >> return i+j
> >> foo._expose_ = [rffi.INT, rffi.INT]
> > It seems like this could also enable a plugin system for rpython,
> > and for example, (c or rpython) extension modules for the PyPy interpreter.
> > Simon.
> I kind of don't understand what are you trying to do. Could you explain
> in a bit more detail? (Ie are you trying to have rffi-rffi bridge
> between interpreter and compiled module?) Why not fix extcompiler instead?
well, the above code would produce:
extern int foo(int i, int j)
(and perhaps an accompanying .h file)
thereby providing an interface for other C programs.
This is rffi producing rather than consuming a C interface.
More information about the Pypy-dev