Discussion:
XS for C++
(too old to reply)
Alberto Simões
2011-12-29 22:13:37 UTC
Permalink
Hello,

I am used to write XS code (well, simple code) for C libraries.
I never did anything for C++ (and I do not know much about C++), but
I'll need to write a simple interface.

Mostly, I need to call a method inside a namespace, and that should be
enough.

Can you suggest any module that interfaces with a C++ library where I
can peek for ideas?

Thank you
Alberto
Shlomi Fish
2011-12-30 09:22:31 UTC
Permalink
Hi Alberto,

On Thu, 29 Dec 2011 22:13:37 +0000
Post by Alberto Simões
Hello,
I am used to write XS code (well, simple code) for C libraries.
I never did anything for C++ (and I do not know much about C++), but
I'll need to write a simple interface.
Mostly, I need to call a method inside a namespace, and that should be
enough.
Can you suggest any module that interfaces with a C++ library where I
can peek for ideas?
off the top of my head:

* http://search.cpan.org/dist/Wx/

* http://en.wikipedia.org/wiki/Kdebindings

However, since these are GUI libraries, the bindings might be generated using
scripts.

Regards,

Shlomi Fish
Post by Alberto Simões
Thank you
Alberto
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Best Introductory Programming Language - http://shlom.in/intro-lang

I invented the term Object‐Oriented, and I can tell you I did not have C++ in
mind. — Alan Kay (Attributed)

Please reply to list if it's a mailing list post - http://shlom.in/reply .
Steffen Mueller
2012-01-02 07:32:21 UTC
Permalink
Post by Shlomi Fish
On Thu, 29 Dec 2011 22:13:37 +0000
Post by Alberto Simões
I am used to write XS code (well, simple code) for C libraries.
I never did anything for C++ (and I do not know much about C++), but
I'll need to write a simple interface.
Mostly, I need to call a method inside a namespace, and that should be
enough.
Can you suggest any module that interfaces with a C++ library where I
can peek for ideas?
* http://search.cpan.org/dist/Wx/
Ouch. Doesn't get much larger than these bindings...

Try looking at ExtUtils::XSpp and specifically at the example:
http://cpansearch.perl.org/src/MBARBON/ExtUtils-XSpp-0.1602/examples/XSpp-Example/

A more real-world example (not at the scale of Wx) would be
Math::Clipper or Math::ThinPlateSpline. Also, my old YAPC slides might
be helpful: http://steffen-mueller.net/talks/xspp/

Cheers,
Steffen

Loading...