[pypy-dev] Python FFI

Leonardo Santagada santagada at gmail.com
Tue May 29 16:38:54 CEST 2012


I think that what laura meant was that pypy people should talk to
luajit people, because if someone came to talk to pypy about ctypes
(the other big ffi for a dynamic language) pypy devs would have said
"don't copy us because in pratictice this design is bad.". As you said
that you talked to luajit author this subject is settled.

On Sun, May 27, 2012 at 12:54 PM, Armin Rigo <arigo at tunes.org> wrote:
>> Sounds great to me.  Except that Mike Pell (LuaJit's author) hasn't
>> been cc'd  on this note.
>
> He has shown up in #pypy to discuss it.
>
>> Because, dear God,
>> if he had not already existed and made this thing, then *we*
>> would be the people with the best working FFI.
>
> I want to emphasis here that it's done "the LuaJIT way".  I don't want
> to pretend having invented anything myself.  If it were not for
> LuaJIT, then very probably we would not have found this solution ---
> although it seems very natural in hindsight.
>
>> No NO NO -- our way was an experiment and too messy to be used.
>
> Unsure what you mean here...  I've used the Python ffi interface on
> some examples, and it seems both clean enough and much more natural
> than packaging tons of objects that you have to learn about first.  It
> is maybe as close to a no-API interface that you can get, provided you
> already know Python and have a basic knowledge of C.
>
> Example: http://bpaste.net/show/30171/   This is as close to the
> original C code as possible, with a small page of C declarations
> copy-pasted from the man pages.  I think that this example alone shows
> that the approach really works, although it should be tried on larger
> examples too.



-- 

Leonardo Santagada


More information about the pypy-dev mailing list