Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Interfacing Perl with C++, using XS, with external files, and using the STL as parameters and return values.

by tsee (Curate)
on Aug 15, 2010 at 09:47 UTC ( #855136=note: print w/ replies, xml ) Need Help??


in reply to Interfacing Perl with C++, using XS, with external files, and using the STL as parameters and return values.

For some reason, you entirely missed a tool called "XS++" which started its existence as the Perl-C++ glue for Wx.

Please have a good look, it will most certainly make your life easier wrt. wrapping C++.

References:


Comment on Re: Interfacing Perl with C++, using XS, with external files, and using the STL as parameters and return values.
Re^2: Interfacing Perl with C++, using XS, with external files, and using the STL as parameters and return values.
by dextius (Monk) on Aug 17, 2010 at 18:41 UTC
    Awesome, I was hoping I'd get a hold of someone who was on top of this.

    The fact that I missed XS++, is pretty laughable, and definitely NOT my fault. I must have re-worded 'perl "C++" XS' 50 different ways on multiple search engines and never ONCE hit XS++. That is pretty frustrating, considering the time and effort I put into researching this, AND the time that Mattia and you must have spent writing XS++ and all this documentation. Heck, I even emailed the Wx mailing list asking for pointers on handling exceptions and multiple objects. I INCLUDED a link to this very post. Mattia himself didn't mention that I wasn't using ExtUtils::XSpp!

    NOBODY mentioned anything about XS++ to what I was doing, not my book (Extending and Embedding), not anyone on Perlmonks, not Ironman Perl, not google. Obviously, I've never heard of it, and OBVIOUSLY, nobody ELSE has either.

    This whole process just feels like a kick in the teeth, and this is the cherry on top.

      I suppose you're talking about the thread on wxperl-users starting here? Quoting Mattia's reply with added emphasis:

      At the moment there is partial support for handling exceptions in XS++: by default all exceptions are caught, and the XS wrapper die()s with a message. If the exception is derived from std::exception, the message includes the text of the what() method, otherwise a generic error message is thrown. Support for propagating the complete exception object to Perl is planned but not implemented yet.

      If for any reason you don't want to use XS++, you need to put a try/catch block around the XS code and handle the exceptions manually

      So while the mention of XS++ could have been more prominent, it was at least there. After all, you were asking this on the wxperl mailing list, so I guess Mattia assumed that you at least had a glance at the source code.

      Either way, Extending and Embedding Perl couldn't have mentioned it. It's an old book. The first standalone release of ExtUtils::XSpp was just a year ago. There are not that many distributions on CPAN that use it and the tools that make it more convenient to use are still in their early stages. The slides of the talk that I pointed you at were from this year's YAPC::EU which ended less than two weeks ago. All things consdidered, it's not that surprising XS++ didn't pop up as the first thing when searching for XS and C++.

      If you're using XS++ and like it, then there's something you can do about the visibility problem yourself: Blog about it. Tell people that and how you use it. Tell us how it helped you or, even better, how it could be more useful. We won't exactly send you away if you wanted to get involved with code either.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2014-09-21 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (175 votes), past polls