[pypy-dev] Why CFFI is not useful - need direct ABI access 4 humans

anatoly techtonik techtonik at gmail.com
Sun Mar 30 13:47:24 CEST 2014


On Sun, Mar 30, 2014 at 12:26 PM, Roberto De Ioris <roberto at unbit.it> wrote:
>
> Hi, (disclaimer: i have worked a lot with cffi, and i basically love it
> because most of my projects are in C and i need to interface with them), i
> am not sure to follow you. You seem to mix C with binary/structures
> manipulation. CFFI is for integration between PyPy/Python and C
> interfaces, so using C (or something really near to it) is its main
> purpose.
>
> If your problem is with structures manipulations, i totally agree, the
> python world need something better (unless i am missing some project
> regarding it), but this is totally irrelevant in the CFFI area.

I mix C with binary manipulation - that's right. I feel like the problem of
efficiently making C calls is a subset of a more generic problem of
converting Python data into corresponding binary data, because C call
looks like a chunk of binary data in memory + register setup.

http://unixwiz.net/techtips/win32-callconv-asm.html

I think that PyPy JIT can do faster calls that C if it was possible to
manipulate with memory on this low level (for instance, providing a
pre-filled memory for a series of calls and then just modifying esp for
each call).

If CFFI included a toolset to construct such binary calls - it would not
be limited to C anymore, and will open ways to engineer more effective
paradigms (Stackless + channels) and better calling conventions for
interop with other useful tools (Go etc.) on binary level.

I started idea with CFFI, because there is no better base to start.
-- 
anatoly t.


More information about the pypy-dev mailing list