473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Which one is better for me , SIP or SWIG ?

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
1 4412
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt Whelan | last post by:
Supposedly, recent versions of SWIG can be made to work with MS VC++'s non-standard integer data types. According to a recent SWIG ChangeLog entry: %apply long long { __int64 }; should make...
1
by: Ernie | last post by:
Hi, I am learning swig to use C codes from Python. Here is the swig file mvf.i: %module mvf %include "carrays.i" %array_class(double, doubleArray); %typemap(out) double, float "$result =...
1
by: Java and Swing | last post by:
I am trying to wrap some C code I have. Currently I have something like... defs.h ----------- typedef unsigned long MY_DIGIT; myapp.c ------------- void MakeDigits(MY_DIGIT digits) {
10
by: Bart Ogryczak | last post by:
Hi, I´m looking for some benchmarks comparing SWIG generated modules with modules made directly with C/Python API. Just how much overhead does SWIG give? Doing profile of my code I see, that it...
1
by: myheartinamerica | last post by:
Hello, I spent the morning figuring out how to use SWIG on Microsoft Windows. I compiled the example from the SWIG tutorial on http://www.swig.org. The biggest stumbling block was not knowing...
1
by: jiangfan | last post by:
Dear All, I am new to SWIG, and I tried to search the SWIG mailinglist for my specific question, but I did not find it. And for a simple one c++ file, I can handle it successfully. Now I have...
1
by: Stodge | last post by:
Yet another SWIG question (YASQ!). I'm having a problem with using an abstract base class. When generating the Python bindings, SWIG thinks that all the concrete classes that derive from this...
1
by: Uberman | last post by:
I have a bit of a odd arrangement here with SWIG, Python, Embedded Python and C++ classes exported into Python. Here's the plot: I have a class defined in a C++ DLL library. I am wrapping this...
0
by: Basha J P M | last post by:
I am beginner in python. I am working through the tutorial examples from http://www.swig.org/ and have run into some problems. I took the following command instructions from the tutorial on...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.