Hacker News new | ask | show | jobs
by jfager 4538 days ago
you're going to be waiting like a decade or so before you can do anything networking related with it

Not true. My 'learn rust' project is pcap-based and has a trivial websocket implementation, and (after the basic learning hump) it's dirt easy. Aside from how simple it is to interact with C, Rust's current networking stack is libuv under the hood (i.e. same as node), and if you don't want libuv, native implementations are landing now.

1 comments

I'm guessing your websockets are not over HTTPS?
No, but they probably could be, there are open-ssl bindings available: https://github.com/sfackler/rust-openssl
I'm going to go ahead and be sceptical of a repo with 3 stars and more tests than working code. I doubt it works, but I didn't try it. It looks like it just wraps open-ssh libraries. It's probably going take more the 3 lines of go it takes now to create a secure wss websocket connection if you use that. I'm going to guess you'll be doing all of your own cert validations and what not once it does work.

EDIT:

It's not petty to point out that a brand new repo that doesn't look like it works, has zero documentation has been seen by a handful of people is not a good example. This is for secure code. SSL. It's pretty important to get right. This isn't a a repo for a JavaScript accordion widget. It's SSL in Rust. I'd like to see SSL in Rust. I want Rust to do well, there's nothing petty, you're reading my tone wrong. It's hard to read intention over text, assume better than you are. I've been sitting in #rust on mozilla IRC for nearly a year watching them develop the language. I'm not just catching up on the latest by reading HN.

As for jfager's a decade vs more than 3 lines rebuttal: read my other responses where I specifically qualify on using C libraries. I am going to going to go ahead and guess you haven't done much raw SSL stuff. It is a ton of work. We're not talking 5 more lines of code. We're talking thousands of lines of code, and that it will be a decade before rust catches up with go. That's just an anonymous commenter making a shitty prediction that nobody will call me out on. My point is that Rust isn't ready. Go is. Stop comparing Go to Rust. Rust doesn't work yet. Don't use it unless you want to help develop the language. All you're going to learn is how to work with a specific half implemented language that can't do basic things yet. Read my original post. I don't hate Rust, I am contrasting the HN echo chamber to love of a language that you should not be using for anything right now. This is not a controversial statement, it's right there in a big highlighted disclaimer on the rust reference manual[1].

[1] http://static.rust-lang.org/doc/0.8/rust.html#disclaimer

Yes, it's just bindings to open-ssl. Yes, it's probably a little clunky to use. But we just went from "a decade or so before you can do anything networking related" to "ssl takes more than 3 lines". I can live with that.
This got petty real fast.