-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does this relate to the zmq crate? #2
Comments
I see your point. I started this project because I needed some CZMQ functionality right away (namely crypto/auth) and liked being lazy about sharing contexts. Also rust-zmq had been static for a while and PRs weren't moving, so it made sense to start this project independently. I think you're right that the binding isn't very "Rusty" and could be improved a lot. I would totally support an effort to take the features of CZMQ and build them into rust-zmq natively. It would also do away with another code dependency, which for me is a win-win! |
While I think of it, a good place to start might be strongly typed message frames. CZMQ refers to them as picture messages (see https://github.com/zeromq/czmq/blob/master/src/zsock.c#L825). You could even bring in Serde for encoding/decoding... I wanted to do that with this binding but never got around to it. |
In a way, There's definitly a lot of useful stuff in CZMQ (I must admit I have never used it), but OTOH, a lot of it seems to overlap with what is provided in the Rust standard library or the "native" Rust ecosystem. Note that the rest of this message is just some pulling some related thoughts off the top of my head.
Edited for typos |
Ok, I just Googled "rust tokio" to figure out what that was ;) I'm pretty new to Rust so not going to make arguments for or against that! Just keep in mind that the whole point of CZMQ was to eliminate much of the common boilerplate C devs were experiencing when implementing ZMQ. There is the same need in any language. The question is simply whether to bind to CZMQ as this lib does, or (time permitting) write a native library that achieves the same goals in a Rusty way. I'm not sure that a translation guide would be all that helpful, as you haven't eliminated boilerplate, you've just talked about it. 😄 |
Full disclosure: I've started hacking a bit on
zmq
lately, so I have an agenda ;-).I wonder how this crate should relate to
zmq
. My goal is to provide high-level, nearly-idiomatic bindings inzmq
, without reducing expressivity compared to the libzmq C API. Both points still need work, obviously.Given that "mission statement" of
zmq
, I'm not sure if having C binding tolibczmq
is the ideal way to achive a "czmq-like" API in Rust. Wouldn't layering it on top ofzmq
itself be a better solution, both in terms of safety (less tricky C bindingunsafe
code), and probably also overall effort?The text was updated successfully, but these errors were encountered: