Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

A few years ago I did a somewhat larger project, which aimed at providing a Perl scripting interface to some PDM (Product Data Management) system, which came with only a C/C++ API.

I got hooked on the 'saving implementation time' thing, and started doing it with SWIG. Problem was I wanted to implement a convenient, more perl-style UI than the original API did provide. In other words, the conversion wrappers had to do a bit more work than mapping simple data types. Well, to make it short, I wasn't able to figure out how to do this with SWIG, though I tried hard.

Ultimately, I ended up redoing the whole thing in XS. It wasn't that much more difficult, and the great advantage was that I essentially could do anything I wanted... So, if you should decide to go with SWIG (after having read the other responses), my advice would be to begin with wrapping the most complex function interface first (maybe after having acquainted yourself with a couple of preliminary easier exercises). This will minimize wasting time. (I had made the error to start with the simple things -- so I essentially did the project twice: 90% in SWIG, then once again in XS...)

Lastly, and somewhat less seriously: using XS would likely boost your ego with that warm and fuzzy feeling of having done it the way most 'real hackers' would do ;)

In reply to Re: $perl_extension ? require SWIG : require XS; by almut
in thread $perl_extension ? require SWIG : require XS; by shonorio

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others pondering the Monastery: (3)
    As of 2017-08-21 07:02 GMT
    Find Nodes?
      Voting Booth?
      Who is your favorite scientist and why?

      Results (318 votes). Check out past polls.