[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [paho-dev] Paho MQTT Rust Language Library
- From: Frank Pagliughi <fpagliughi@xxxxxxxxxxxxxx>
- Date: Tue, 7 Nov 2017 09:07:21 -0500
- Delivered-to: email@example.com
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=dk12062016; d=mindspring.com; b=dsMMJMGKves+rYB0XYP81zhBJlz+0+8oQGpNKDkDUZqRgjdbJX3x9mxy0pknfCDRyTkGTWwVhQ821iZaAeHfdVOnuxXJfKdKn4+11F3l31Fa6Fhgf+Za3462z+EB72WkZxlUAhL8I3G71ahiIF46gBTW5c7pRtBEEiSMWBhUNNmdzHmG0EFN922H0gWjxYZlffuJeBCcwprBDvKjt/FEK4SudqwG/ttND7LepxsmYBhbYvFa9OAMoTNu3xC6vLZTEKo63aJeWWTFzb7VYZd6S3HvzyQn8fXcrQStX6RLGrKIcBKKoOEmDIUtXbPx2n4Df5iX2QZaZL2n420szGqFfg==; h=Received:Subject:To:References:From:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Content-Language:X-ELNK-Trace:X-Originating-IP;
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0
I found a number of MQTT libraries for Rust, but none seemed complete or
up-to-date. Strangely, while researching how to wrap C library calls in
Rust, I repeatedly found questions by people who were attempting to wrap
the Mosquitto API. So it seems that there is some MQTT interest in the
I've found Rust to be very intriguing. It's a compiled, typed language,
and overlaps the space where C and C++ would be used. A primary feature
is its concept of memory ownership and borrowing whereby the compiler
tracks references to memory distinguishing between mutable and immutable
variations - even across threads - to prevents race conditions. The
compiler tends to nag about these things, like an overbearing
grandmother, forcing you to promise you'll never do bad things again.
But in the end, when you grow up, you know she's right.
I recommend people have a look at Rust. If nothing else, it will make
you reconsider the way you program C and C++.
Working with Rust has once again brought up the concept of "const-ness"
in the C library. If the library receives a buffer which it will not
change, it should mark the buffer as being "const" (as const void* or
const char*, etc). It has been moving in that direction for a while now,
but we should give a review to make sure that it's consistent. I can
help with that.
My intent was to knock out an initial, stable, version that worked with
the existing Paho 1.3, but I definitely intend follow it with the MQTT
v5 additions. If you're ready to get started, then perhaps some of that
work will happen in parallel.
Let's start to discuss work and schedules.
On 11/07/2017 06:32 AM, Ian Craggs wrote:
thanks, that's great progress!Â Were there any existing MQTT clients
Can you give an idea of when one might consider using the Rust
language - an alternative to C?
I intend to start working on updates to the C client for MQTT V5 soon,
I don't know if you'd like to accommodate those changes at the same
time?Â I haven't formulated the API changes yet - I'll need to do that
On 07/11/2017 05:08, Frank Pagliughi wrote:
I've started uploading some code for a new Paho Rust Language library
The code is initially going into an "incubator" branch to indicate
that it is highly unstable and will be changing quickly over the next
few weeks. It's a wrapper around the Paho C library, and the first
version will target the Paho 1.3 release for MQTT v3.1 and 3.1.1.
It's very early days, but the library can connect (via TCP or
SSL/TLS), publish, subscribe, and disconnect cleanly using an
asynchronous interface. I'm currently developing on Linux x86_64, but
other platforms that are supported by Rust and Paho C should be
relatively straightforward. At this point, the library sorely lacks
error handling, documentation, and stability.
I'm hoping to stabilize the API by the end of the year and release in
I'm a relative newcomer to Rust (as, apparently, are 97% or Rust
users), so am hoping to get advice and guidance on the API from
others having more experience with the language. But I also hope to
keep it familiar to existing Paho users.
So far, I'm fairly impressed with Rust. It looks like an interesting
language for some MQTT programming. Fast and safe.
paho-dev mailing list
To change your delivery options, retrieve your password, or
unsubscribe from this list, visit