[Cython] [GSoC] Python backend for Cython using PyPy's FFI

Romain romain.py at gmail.com
Thu Apr 7 22:36:35 CEST 2011

Hi again

PyPy has functions to parse C headers to get macros and constants so I could
create C functions to wrap the macros and probably inline constants in the
Python part of the wrapper. This doesn't solve the problem of ifdefs but
this is a start.


2011/4/7 Carl Witty <carl.witty at gmail.com>

> On Thu, Apr 7, 2011 at 9:06 AM, Dag Sverre Seljebotn
> <d.s.seljebotn at astro.uio.no> wrote:
> > This seems similar to Carl Witty's port of Cython to .NET/IronPython. An
> > important insight from that project is that Cython code does NOT specify
> an
> > ABI, only an API which requires a C compiler to make sense. That is; many
> > wrapped C libraries have plenty of macros, we only require partial
> > definition of struct, we only require approximate typedef's, and so on.
> >
> > In the .NET port, the consequence was that rather than the original idea
> of
> > generating C# code (with FFI specifications) was dropped, and one instead
> > went with C++/CLR (which is a proper C++ compiler that really understands
> > the C side on an API level, in addition to giving access to the .NET
> > runtime).
> Let me just add that a way to deal with the API vs. ABI issue would be
> useful for other potential Cython targets as well, such as IronPython
> using C# and Jython.  (A C# port for IronPython would be more valuable
> than my C++/CLI port because it would work under Mono -- Mono doesn't
> have a C++/CLI compiler and probably never will.)
> Carl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cython-devel/attachments/20110407/ce640a47/attachment.html>

More information about the cython-devel mailing list