YAPC::NA 2014 • Orlando, FL

Foreign Function Interface (FFI): Never Need to Write XS Again

By Graham Ollis (‎plicease‎) from DC.pm
Date: Monday, 23 June 2014 15:00
Duration: 50 minutes
Target audience: Intermediate
Language: English
Tags: alien ffi infrastructure libarchive

You can find more information on the speaker's site:


Foreign Function Interface (FFI) is a popular method of implementing extensions that rely on C libraries in languages such as Ruby, Python and Java. FFI has not hit the big time in Perl, but it has some advantages over Perl’s historical extension language XS. Migrating parts of CPAN from XS to FFI may ease the transition to alternative Perl implementations or Perl 6. In this talk I will compare and contrast the two techniques in the context of Perl today, using as an example the work that I did implementing FFI bindings for libarchive with FFI::Raw (Archive::Libarchive::FFI). I will focus on work I did creating and using infrastructure that should be applicable to many FFI projects. I will also discuss the development of the Alien::Libarchive module to make available libarchive to the FFI bindings that I wrote. I will make suggestions as to how Alien infrastructure could be improved to better work with FFI projects.

Attended by: