Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: $perl_extension ? require SWIG : require XS;

by Util (Priest)
on Jan 06, 2007 at 18:33 UTC ( #593318=note: print w/ replies, xml ) Need Help??


in reply to $perl_extension ? require SWIG : require XS;

I think Sriram's advice in A.P.P.1 should be considered very out-of-date.

  1. 1997: Advanced Perl Programming (First Edition) by Sriram Srinivasan
    • Pages on SWIG: 5, XS: 4, Both: 8, Inline: 0.
    • SWIG underwent a major rewrite between 1999 and 2001.
  2. 2002: Extending and Embedding Perl by Tim Jenness and Simon Cozens
    • Pages on SWIG: 6, XS: 200+, Inline: 10.
  3. 2005: Advanced Perl Programming (Second Edition) By Simon Cozens
    • Complete rewrite, with little overlap from the First Edition.
    • One whole chapter on Inline.
From A.P.P.2 - "Packaging Inline Modules":
In the past I'd always seen Inline::C as useful for prototyping, or a simple glue layer between C and Perl for quick hacks, and would discourage people from using it for the "serious" business of creating CPAN modules.
However, Brian "Ingy" Ingerson has worked hard on these issues and there are now two equally suitable ways to write fully functional Perl modules in Inline, without bothering with XS.


Comment on Re: $perl_extension ? require SWIG : require XS;
Re^2: $perl_extension ? require SWIG : require XS;
by tsee (Curate) on Jan 07, 2007 at 12:30 UTC

    APP2 isn't quite up-to-date here:

    We now have InlineX::C2XS, InlineX::CPP2XS and InlineX::XS. The first two modules convert the code from Inline::C or Inline::CPP respectively into "stand-alone" XS. InlineX::XS is a wrapper for Inline::C which can auto-convert the inlined C (or rather the inlined XS) into "stand-alone" XS code during make dist time.

    This means that you can write a module using Inline::C and use that for a rapid development and benefit from the close Perl+C association that makes Inline::C attractive. Then, when you're ready to upload to CPAN, you just make dist and get an ordinary CPAN distribution that does not rely on Inline::C. Sounds whacky? Probably. Have a look at the documentation for a better explanation of the concept.

    Cheers,
    Steffen

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://593318]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-08-21 12:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (134 votes), past polls