[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Python MQTT native vs. as binding

I would be curious to know if people have experience with SWIG? http://www.swig.org/
It seems to provide a nice way to generate palatable bindings to native libraries (i.e it provides flexibility on how the language-specific APIs should look like, and helps maintain several language bindings easily if the underlying native libraryâs API evolves).

You can look at the *.i files in there - https://github.com/intel-iot-devkit/upm/tree/master/src/bma220 - as an example of how Intel UPM uses SWIG for Java, JS, and Python out of C++ code
One thing that Iâm not sure of, for the very little Iâve looked at Intelâs stuff, is the footprint/efficiency of the generated SWIG code.

Benjamin -

Le 1 dÃc. 2017 Ã 13:59, Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> a Ãcrit :

Hi Jos,

the answer is yes :-)

I wrote a Python binding a while ago, but when I first talked about it, a had a couple of comments about a pure Python client being more desirable, so I let it have a low profile.  I haven't touched it in a couple of years, so it might need updating.  You can find it in the test directory of project:


If there is interest, I can look into adding it to the project properly.  And obviously I would appreciate any contributions made in this area :-)

I haven't done any performance comparisons between Python and C implementations, so I can't comment to the size of the advantage, if any.


On 01/12/2017 12:41, Jos Vos wrote:

Just wondering:

The Paho-MQTT Python package now seems to implement the MQTT protocol
purely in Python.  I'm using it and in principle I'm happy with it.

But did someone ever think of writing a Python binding for the Paho-C
library and could that improve performance for high-volume clients
(think of thousands of messages per second received/published)?

Ian Craggs
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto

paho-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Attachment: signature.asc
Description: Message signed with OpenPGP