Re: librbd ports to perl

[email protected] (Yonghua Peng) Mon, 16 Nov 2015 13:43:44 +0800
Newsgroups perl.xs
Message-ID <[email protected]>
Thanks a lot. I will check them.


On 2015/11/16 ζ˜ŸζœŸδΈ€ 13:34, Ben Bullock wrote:
> On 15 November 2015 at 09:02, Yonghua Peng <[email protected]> wrote:
>
>> There are ruby/java/python/go ports for librbd (ceph's rados block device,
>> see ceph.com), but there isn't perl's.
>>
>> For example,
>>
>> python's -
>> https://github.com/ceph/ceph/blob/v0.48.2argonaut/src/pybind/rbd.py
>>
>> ruby's -
>> https://github.com/ceph/ceph-ruby/blob/master/lib/ceph-ruby/lib/rbd.rb
>>
>> Can you show me how to ports that into perl language? I just want to create
>> a module called Ceph::Lib::Rbd.
>
> If you want to just do like that Python or Ruby does, you can use Perl
> modules like
>
> https://metacpan.org/pod/FFI
> https://metacpan.org/pod/FFI::Raw
> https://metacpan.org/pod/FFI::Platypus
>
> (I have never tried these modules, but I looked at the Ruby and Python
> code and wondered if the FFI thing was on CPAN, and found the above.
> It seems like the Raw and Platypus versions have several votes.)
>
> Perl XS is quite tricky since it requires understanding Perl internals
> like reference counting.
>