Hacker News new | ask | show | jobs
by sophacles 6003 days ago
My personal preferences are: Boost.python for C++[1], and Pyrex/Cython for C wrappers. Both make things pretty nice. I never really got into swig, so I'm not sure if there is noticable speedup betwen any of these. As for handwritten wrappers, I have not had any personal experience trying to eke the extra speed from not using a code generator type wrapper. hth
1 comments

Swig solves a somewhat different problem than Boost.python/pyrex. Swig works better when you have an existing C++ codebase you want to call from python while making as few changes to the C++ side as possible, while Pyrex/Boost work better when you are writing a C or C++ module from scratch to be called from python.