Which one is better for me , SIP or SWIG ?

F

fdu.xiaojf

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
 
D

Diez B. Roggisch

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top