Re: mixing C and python with cffi

47 views
Skip to first unread message

Hakan Ardo

unread,
Jul 11, 2012, 12:55:45 PM7/11/12
to Armin Rigo, pytho...@googlegroups.com
On Wed, Jul 11, 2012 at 6:09 PM, Armin Rigo <ar...@tunes.org> wrote:
> Hi Hakan,
>
> On Wed, Jul 11, 2012 at 5:00 PM, Hakan Ardo <ha...@debian.org> wrote:
>> I've been playing with cffi to find a framework for doing mixed C and
>> python development. The idea is to assume the common practice of
>> having xxx.h declare what's implemented in xxx.c and to strengthen the
>> #include<xxx.h> statement to also mean that xxx.c needs to be linked
>> in. Then I mark some part of xxx.h as a suitable cdef and allow python
>> to import C symbols from xxx by dynamically recompiling it when
>> needed. Here is a somewhat hacky prototype:
>
> It may be useful but it all feels like a collection of hacks. I'm
> very unlikely to accept these patches into the "main" cffi :-) But
> feel free to discuss it more on the cffi mailing list at
> pytho...@googlegroups.com .

Yes I suppose it is a collection of hacks at present, but I think it
can be formalized. Keeping it as a separate module using cffi might
make sens though.

--
Håkan Ardö

Fruch

unread,
Jul 27, 2012, 4:45:50 AM7/27/12
to pytho...@googlegroups.com
Can you send a code sample, this looks interesting.

But it's only a forward of the mail with the code dropped out

Armin Rigo

unread,
Jul 27, 2012, 5:09:47 AM7/27/12
to pytho...@googlegroups.com
Hi Fruch,

On Fri, Jul 27, 2012 at 10:45 AM, Fruch <israel....@gmail.com> wrote:
> Can you send a code sample, this looks interesting.

Ah, sorry. The public mails dropped the crucial line:

hg clone ssh://h...@bitbucket.org/hakanardo/cmix


Armin
Reply all
Reply to author
Forward
0 new messages