Using Inline :: CPP vs SWIG - when?

In this question, I saw two different answers on how to directly access functions written in C ++

  • Inline :: CPP (and here more, for example Inline :: C, Inline :: Lua, etc.)
  • Swig
  • Handmade (as Daxim said - most modules are handwritten)

I just looked through almost all the questions in SO tagged [perl] [swig] to find the answer to the following questions:

  • What are the main differences between choosing SWIG and Inline :: CPP or handwriting?
  • When is "good practice" - is it recommended to use Inline :: CPP (or Inline: C), and when will it be suggested to use SWIG or Handwritten?

As I think of this, the use of SWIG is more universal for other purposes, for example, in this matter, and Inline :: CPP depends on perl. But, from the point of view of perl, is there any significant difference here?

+5
source share
2 answers

I have not used SWIG, so I cannot speak directly. But I'm pretty familiar with Inline :: CPP .

++, Perl, Inline:: CPP . ++ , . Inline:: CPP, , ; .

Inline:: CPP 100% . ++, C, Perl, ++ , - Perl. Inline:: CPP 94% CPAN. 6% , , ++.... , .

, , , 95%, Inline:: CPP. , , Inline:: CPP . (VERSION NAME) Makeake.PL ExtUtils:: MakeMaker Inline:: MakeMaker ( ExtUtils:: MakeMaker). CONFIGURE_REQUIRES ExtUtils:: MakeMaker ; , .

, , , 94%, Inline:: CPP, Inline:: CPP. , , ; . Inline:: CPP, InlineX:: CPP2XS, XS-. , Inline:: CPP.

++ - , Inline:: CPP . typemap, , ( ) , "guts and API". , , - , Unicode. API.

++, Inline:: CPP, . STL. STL , Inline:: CPP , . POD ( ), STL. , , ++ , Perl , , compiletime. , , Inline:: CPP, ; .

, , . Inline:: CPP, -, , , Inline:: CPP.

Inline:: CPP ++. , .

Inline:: CPP Swig , perlguts, perlapi perlcall, , Swig Swig - , , Perl, , , , CPAN.

Inline:: CPP , Perl. , Perl XS, Inline:: C Inline:: CPP, , Swig Perl. XS , , , Perl Swig.

Inline:: CPP inline@perl.org. , Inline:: C Inline-family , , , Inline.

Perl Mongers Inline:: CPP, , . , Math::Prime::FastSieve Inline:: CPP ( Inline:: CPP), , Rob (sisyphus), Inline InlineX:: CPP2XS InlineX::CPP2XS, Math:: Prime:: FastSieve XS-, InlineX:: CPP2XS.

+6

, ExtUtils:: XSpp. , , , Inline:: CPP SWIG, .

+1

All Articles