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 ;)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- 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
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||