Personally ...
I find that XS makes faster code, since it does not insert another layer of abstraction like SWIG. I think that XS is the best long term solution, since it is the interface provided with perl, and creates very tightly integrated code (letting you handle argument stacks and such as needed). But, i have to admit, porting large libraries can be tedious (but worth it in my opinion)
When i have used SWIG, i have found that quite often it creates code with minor problems that have to be fixed to get it to compile. Since SWIG creates an entire abstraction layer, this C-diving is not simple. But, if the code it creates works, it is ver fast to impliment.
For me, SWIG is quicker to create code, but XS creates better code. Your milage may vary.
from the frivolous to the serious
| [reply] |
| [reply] |
Tahnks.
Though the discussion doesn't shed some light on what I don't understand:
Is XS able to work with C++ code?
Is SWIG able to ( answer yes).
Wich one is faster to implement?
From what I read SWIG might be the choice for me since I need C++ and speed and not too much C programation...
--IN doubt, reboot --
Solonet
| [reply] |
| [reply] |
I've never personally used SWIG, but from what I hear it's a bit easier to pick up. The down side is that since it's targeted towards working with multiple languages you might not be able to do things in the most perly way. You also want to look at Inline and friends (specifically Inline::CPP).
| [reply] |
I thought I would just mention one thing. Swig is NOT working
flawlessly on perl5.8. It won't work for me anyways. But swig is easy,
I never could figure out XS. ;-( If you are going to use it on 5.6.1 it's no problem. | [reply] |