Rust implementation status

Sascha Grunert saschagrunert at icloud.com
Mon Mar 13 17:58:58 CET 2017


Hello Vladimir,

I just read that there is another WireGuard Rust implementation here:
https://github.com/sopium/titun/tree/wg

1. Instead of hand-rolling your own error management implementation,
consider using the error-chain[1] crate. It seems that many popular
crates now depend on it[2]. It would make the Wireguard crate more
interoperable and more readable for those who is already accustomed
with error-chain. On the first glance, your custom implementation
resembles error-chain very much.

This sounds great, I or we can go forward with that crate if it provides
better error handling.
 
2. Consider publishing the project on some hosting service like Github
or Gitlab or something else, which would allow easier community
participation. I would very much like to help with its development, but
I never participated in any mailing-list based projects and I
personally find it very inconvenient, and I think that the pull
requests mechanics is greatly superior. Also, almost all Rust ecosystem
lives on Github, so lots of Rust developers are quite accustomed to it,
and you will most certainly attract more contributors that way.

I already thought about this but the project owner wants to have a single
place where the sources lives. But mirroring code is possible as well,
like we already do on github: https://github.com/WireGuard/wireguard-rs
 
3. On a related note, consider publishing a link to this project in the
Rust community, in particular, in the Rust subreddit[3] and maybe on
The Rust Programming Language Forum[4]. I think that many people there
will be very interested in a project like this, because it is network-
related, it is pretty low level, and it will probably depend on the
current "hot" crates in the Rust community, like tokio.

Yes this is a good idea and we can do that if we have a small working
prototype. :)
 
4. I think it would be quite idiomatic to split the interface to WG
into a separate library crate, which the main binary would depend on.

Yeah sounds reasonable. Lets look forward to this.
 
5. I wonder, is it really necessary to perform daemonization manually?
As far as I understand the current situation in the daemon writing and
init systems, it is expected that daemons won't fork themselves and
will continue working in foreground when started, while service
management systems like systemd or launchd will take care of keeping
them alive, collecting logs, starting, restarting, etc. Daemonizing
also seems quite unidiomatic on Windows. I also personally think that
avoiding manual daemonization will make the code and architecture
simpler and more manageable.

The actual implementation follows strictly this guideline:
https://www.wireguard.io/xplatform/
Usually I agree in letting the daemon stuff to systemd or something else,
but we want to avoid fragmentation, that different implementations behave
differently.
 
6. Have you decided which cryptographic libraries you are going to use?
Or are you planning to implement the necessary primitives in this
project?

Not now, there is no such decision done yet.

I am looking really further for your contribution, since it is currently a "one man show",
which is pretty though for me.

I know that a main development on GitHub would spread the project better into the
open source world. Maybe we need to discuss this point at some time.

Best regards,
Sascha

Am 13. März 2017 um 00:10 schrieb Vladimir Matveev <dpx.infinity at gmail.com>:

Hi, Sascha,

I'm a Rust programmer, and I really like that there is now a Rust
implementation of the Wireguard daemon!

I have a few question and suggestions.

1. Instead of hand-rolling your own error management implementation,
consider using the error-chain[1] crate. It seems that many popular
crates now depend on it[2]. It would make the Wireguard crate more
interoperable and more readable for those who is already accustomed
with error-chain. On the first glance, your custom implementation
resembles error-chain very much.

2. Consider publishing the project on some hosting service like Github
or Gitlab or something else, which would allow easier community
participation. I would very much like to help with its development, but
I never participated in any mailing-list based projects and I
personally find it very inconvenient, and I think that the pull
requests mechanics is greatly superior. Also, almost all Rust ecosystem
lives on Github, so lots of Rust developers are quite accustomed to it,
and you will most certainly attract more contributors that way.

3. On a related note, consider publishing a link to this project in the
Rust community, in particular, in the Rust subreddit[3] and maybe on
The Rust Programming Language Forum[4]. I think that many people there
will be very interested in a project like this, because it is network-
related, it is pretty low level, and it will probably depend on the
current "hot" crates in the Rust community, like tokio.

4. I think it would be quite idiomatic to split the interface to WG
into a separate library crate, which the main binary would depend on.

5. I wonder, is it really necessary to perform daemonization manually?
As far as I understand the current situation in the daemon writing and
init systems, it is expected that daemons won't fork themselves and
will continue working in foreground when started, while service
management systems like systemd or launchd will take care of keeping
them alive, collecting logs, starting, restarting, etc. Daemonizing
also seems quite unidiomatic on Windows. I also personally think that
avoiding manual daemonization will make the code and architecture
simpler and more manageable.

6. Have you decided which cryptographic libraries you are going to use?
Or are you planning to implement the necessary primitives in this
project?

I'm really looking forward to the further development of this project,
and I'm willing to participate in it if you're looking for
contributors.

Best regards,
Vladimir

[1]: https://crates.io/crates/error-chain
[2]: https://crates.io/crates/error-chain/reverse_dependencies
[3]: https://www.reddit.com/r/rust/
[4]: https://users.rust-lang.org/
_______________________________________________
WireGuard mailing list
WireGuard at lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/wireguard/attachments/20170313/dc36dac6/attachment-0001.html>


More information about the WireGuard mailing list