Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document suggestion to use libffi for simple library bindings #16671

Closed
p5pRT opened this issue Aug 24, 2018 · 9 comments · Fixed by #17373
Closed

Document suggestion to use libffi for simple library bindings #16671

p5pRT opened this issue Aug 24, 2018 · 9 comments · Fixed by #17373

Comments

@p5pRT
Copy link

p5pRT commented Aug 24, 2018

Migrated from rt.perl.org#133474 (status was 'open')

Searchable as RT133474$

@p5pRT
Copy link
Author

p5pRT commented Aug 24, 2018

From @Grinnz

Perl XS is a vastly complex tool that isn't always needed where libffi
interfaces may have a significantly lower barrier of entry for certain
tasks. This is an attempt at pointing users to this option in perlxs.
(Patch will be attached in next message)

For simple bindings to C libraries as well as other machine code libraries,
consider instead using the much simpler
L<libffi|http​://sourceware.org/libffi/> interface via CPAN modules like
L<FFI​::Platypus> or L<FFI​::Raw>.

-Dan

@p5pRT
Copy link
Author

p5pRT commented Aug 24, 2018

From @Grinnz

Patch attached.

@p5pRT
Copy link
Author

p5pRT commented Aug 24, 2018

From @Grinnz

perlxs_ffi.patch
diff --git a/dist/ExtUtils-ParseXS/lib/perlxs.pod b/dist/ExtUtils-ParseXS/lib/perlxs.pod
index 1419ee0ddf..e9b2ef3e32 100644
--- a/dist/ExtUtils-ParseXS/lib/perlxs.pod
+++ b/dist/ExtUtils-ParseXS/lib/perlxs.pod
@@ -79,6 +79,11 @@ Note: For some extensions, Dave Beazley's SWIG system may provide a
 significantly more convenient mechanism for creating the extension
 glue code.  See L<http://www.swig.org/> for more information.
 
+For simple bindings to C libraries as well as other machine code libraries,
+consider instead using the much simpler
+L<libffi|http://sourceware.org/libffi/> interface via CPAN modules like
+L<FFI::Platypus> or L<FFI::Raw>.
+
 =head2 On The Road
 
 Many of the examples which follow will concentrate on creating an interface

@p5pRT
Copy link
Author

p5pRT commented Aug 25, 2018

From @xsawyerx

+1 from me.

On 08/25/2018 02​:54 AM, Dan Book via RT wrote​:

Patch attached.

---
via perlbug​: queue​: perl5 status​: new
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=133474

@p5pRT
Copy link
Author

p5pRT commented Aug 25, 2018

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Aug 25, 2018

From @xsawyerx

+1 from me.

On 08/25/2018 02​:54 AM, Dan Book via RT wrote​:

Patch attached.

---
via perlbug​: queue​: perl5 status​: new
https://rt-archive.perl.org/perl5/Ticket/Display.html?id=133474

@p5pRT
Copy link
Author

p5pRT commented Aug 25, 2018

From @mohawk2

Might it also be worth mentioning the small CPAN Module NativeCall?

@p5pRT
Copy link
Author

p5pRT commented Aug 25, 2018

From [Unknown Contact. See original ticket]

Might it also be worth mentioning the small CPAN Module NativeCall?

@p5pRT
Copy link
Author

p5pRT commented Aug 25, 2018

From @Grinnz

On Sat, 25 Aug 2018 15​:03​:51 -0700, etj@​cpan.org wrote​:

Might it also be worth mentioning the small CPAN Module NativeCall?

I considered this but it's only a P6-inspired wrapper of FFI​::Platypus, I think pointing people to the two options for libffi usage is sufficient for core perldocs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant