By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,813 Members | 1,130 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,813 IT Pros & Developers. It's quick & easy.

Which one is better for me , SIP or SWIG ?

P: n/a
Hi all,

I am going to generate a python wrapper of a C library, and I am
wondering which one is a better tool for me, SIP or SWIG ?

SWIG supports many scripting languages such as python, ruby, and perl,
while SIP is specific to python, so I think maybe SIP is more suitable
to generate better wrappers(sorry for my ignorance if I am wrong at this
point) with python.

But it seems that SIP is mainly used for pyQT and hasn't gained general
acceptance with python community.

Could someone give me a better comparison of SIP and SWIG ?

My concerns:

1. I just want an python wrapper for C/C++ code. The support of other
scripting languages is not important.

2. Easy to learn and easy to use.

Any comments will be greatly appreciated.

Regards,

xiaojf
Nov 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
fd********@gmail.com schrieb:
Hi all,

I am going to generate a python wrapper of a C library, and I am
wondering which one is a better tool for me, SIP or SWIG ?

SWIG supports many scripting languages such as python, ruby, and perl,
while SIP is specific to python, so I think maybe SIP is more suitable
to generate better wrappers(sorry for my ignorance if I am wrong at this
point) with python.

But it seems that SIP is mainly used for pyQT and hasn't gained general
acceptance with python community.

Could someone give me a better comparison of SIP and SWIG ?

My concerns:

1. I just want an python wrapper for C/C++ code. The support of other
scripting languages is not important.

2. Easy to learn and easy to use.
The reasons SIP hasn't gained more attraction are dark to me. At least
when it comes to C++, it's support is waaay better than SWIG. There also
exists some Boost Python stuff, but I never wrapped my head around that.

However, if you are "only" wrapping C, pyrex is my tool of choice. It
has build-in distutils support, and it is very easy to write. So if you
can, go with pyrex. If you must wrap C++, go with SIP - boost
non-withstanding.

Diez
Nov 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.