[Cython] new FFI library for Python

2012-06-18 Thread Stefan Behnel
Hi,

the PyPy folks have come up with a new FFI library (called cffi) for
CPython (and eventually PyPy, obviously).

http://cffi.readthedocs.org/

It borrows from LuaJIT's FFI in that it parses C declarations at runtime.
It then builds a C extension to access the external code, i.e. it requires
a C compiler at runtime (when running in CPython).

Just thought this might be interesting.

Stefan
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] new FFI library for Python

2012-06-18 Thread Philip Herron
On 18 June 2012 15:12, Stefan Behnel  wrote:
> Hi,
>
> the PyPy folks have come up with a new FFI library (called cffi) for
> CPython (and eventually PyPy, obviously).
>
> http://cffi.readthedocs.org/
>
> It borrows from LuaJIT's FFI in that it parses C declarations at runtime.
> It then builds a C extension to access the external code, i.e. it requires
> a C compiler at runtime (when running in CPython).
>
> Just thought this might be interesting.
>
> Stefan
> ___
> cython-devel mailing list
> cython-devel@python.org
> http://mail.python.org/mailman/listinfo/cython-devel

I have been using libffi in my gccpy runtime wonder why they decided
to make a new one and not use libffi

--Phil
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] new FFI library for Python

2012-06-18 Thread Stefan Behnel
Philip Herron, 18.06.2012 17:26:
> On 18 June 2012 15:12, Stefan Behnel wrote:
>> the PyPy folks have come up with a new FFI library (called cffi) for
>> CPython (and eventually PyPy, obviously).
>>
>> http://cffi.readthedocs.org/
>>
>> It borrows from LuaJIT's FFI in that it parses C declarations at runtime.
>> It then builds a C extension to access the external code, i.e. it requires
>> a C compiler at runtime (when running in CPython).
>>
>> Just thought this might be interesting.
> 
> I have been using libffi in my gccpy runtime wonder why they decided
> to make a new one and not use libffi

Isn't libffi RPython? That's enough of a reason, I'd say.

Stefan
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] new FFI library for Python

2012-06-18 Thread Stefan Behnel
Stefan Behnel, 18.06.2012 16:12:
> the PyPy folks have come up with a new FFI library (called cffi) for
> CPython (and eventually PyPy, obviously).
> 
> http://cffi.readthedocs.org/
> 
> It borrows from LuaJIT's FFI in that it parses C declarations at runtime.
> It then builds a C extension to access the external code, i.e. it requires
> a C compiler at runtime (when running in CPython).
> 
> Just thought this might be interesting.

The code is here, BTW:

https://bitbucket.org/cffi/cffi/

One interesting feature is that they seem to support different backends.
There's apparently one for libffi and one for ctypes so far. Another one
based on Cython would be cool. Even the existing ffi backend implementation
would have looked better in Cython, it's currently some 3000 lines of C
code. And Cython could certainly benefit from an ffi backend itself for a
couple of tasks, this topic has come up before a couple of times.

Stefan
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel