FFI::Raw, Ctypes, FFI, and other foreign function interfaces

133 views
Skip to first unread message

David Mertens

unread,
Apr 30, 2012, 6:51:12 PM4/30/12
to ale...@cpan.org, Reini Urban, perl-c...@googlegroups.com, Ryan Jendoubi, Gaal Yahas, Anatoly Vorobey
Alessandro -

I noticed that you've put out a foreign-function interface library under FFI::Raw in the last couple of weeks! Your work on this is highly coincidental with other recent Perl developments with FFI-ish stuff. I am writing to you to make sure you're aware of these efforts, and in hopes that you might consider joining one or both of the two existing projects.

Ryan Jendoubi and Reini Urban worked on an interface to libffi that they called Ctypes. Their work started in 2010 and nearly reached a point of publication, but never quite made it to CPAN. You can find their work here: http://gitorious.org/perl-ctypes. As your library works with libffi, you might consider working with Ryan and Reini to help get their fairly sophisticated interface finished up and pushed to CPAN.

Gaal Yahas and Anatoly Vorobey picked up the original FFI.pm (which is based on what I call FFCall, though the relation between FFCall and libffi is murky to me) many years ago and released what is now FFI 1.04 on CPAN back in 2008. The problem with their library is that it depends on FFCall, which as far as I can tell is no longer easy to find.

I have an interest in a working FFI because I am working on Perl bindings for the Tiny C Compiler and need a way to call functions that are compiled just-in-time. This has coalesced with Joel Berger's work on Alien::Base, which could also make use of some sort of FFI for testing Alien libraries without necessarily building XS modules around them. Inversely, I have just written Alien::FFCall and Alien::FFI, Alien modules for the two libraries so far discussed, and just today I pushed a developer's release of FFI.pm that now uses Alien::FFCall. (If you continue working on FFI::Raw, you might be interested in using Alien::FFI to use CPAN to guarantee that your users have libffi on their machines. You can learn more about those bindings, which haven't yet hit CPAN, here: https://github.com/run4flat/Alien-FFI.)

Anyway, now you know. In light of these projects, do you think you'll continue working on FFI::Raw? Do you think you might join one of these other two projects?

Thanks!
David

--
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

Reply all
Reply to author
Forward
0 new messages