Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I had a great experience interfacing C++ code with Python using both SWIG and SIP. While latter seems to be a bit more powerful for binding C++ code (as it handles many of the intricacies of operator overloading, polymorphism, virtual functions and class inheritance with ease), SWIG does support other languages besides Python (also I think SIP is modeled after SWIG).

For calling C functions cffi or ctypes is usually easier and incurs less overhead, but for rich C++ interfaces there is just no alternative to using a binding generator, as the required code becomes large very fast.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: