🌻 pl.atypus.org - Home for the Perl Platypus Project

FFI::Platypus (pronounced as just "Platypus" when nonambiguous) is a Perl library for creating interfaces to machine code libraries written in languages like C, C++, Go, Fortran, Pascal and Rust.

use FFI::Platypus 2.00;
my $ffi = FFI::Platypus->new( api => 2 );
$ffi->lib(undef); # search libc
$ffi->attach( puts => ['string'] => 'int' );
puts('hello world');

Platypus has several advantages over XS for writing library bindings in Perl:

Platypus is implemented on libffi, which has been battle tested on a number of other scripting languages, like Python and Ruby to serve a similar role.

Excited to learn more? The FFI::Platypus documentation includes a number of helpful examples.

Resources hosted here

External Links