http://www.perlmonks.org?node_id=855566


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

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.
  • Comment on Re^2: Interfacing Perl with C++, using XS, with external files, and using the STL as parameters and return values.

Replies are listed 'Best First'.
Re^3: Interfacing Perl with C++, using XS, with external files, and using the STL as parameters and return values.
by tsee (Curate) on Aug 18, 2010 at 09:11 UTC

    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.