Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't know how anybody can say this with a straight face.

Even in a systems context I think it's pretty reasonable to want to either perform or receive a HTTP request, as soon as you do that in Rust you are funneled into Hyper or something built on top of it (like reqwest) and instantly are dependent on tokio/mio.

The very first example in the reqwest readme^1 has tokio attributes, async functions AND trait objects. It's impossible that a beginner attempting to use the language to do anything related to networking won't be guided into the async nightmare before they have even come to grips with the borrow checker.

1. https://crates.io/crates/reqwest



Reqwest lets you choose between async or not. It has a "blocking" module with a similar API, but no async functions.

https://docs.rs/reqwest/0.11.2/reqwest/blocking/index.html

(Maybe this uses async rust under the hood, but you don't have to care about it)


It is not a question of whether something is blocking or not, blocking is easy. It is a question of whether you can have asynchronicity without await/async. And you can, using mio, as jstrong suggested. You'll manually poll the event loop.


jstrong didn't mention anything about beginners or how a typical user is nudged. It's just a description of how they work. They even pointed out which HTTP library they use. There is nothing in their post that requires a curved face.


Try https://github.com/algesten/ureq, it’s very nice and not async.


You can avoid async ecosystem with mio_httpc for http client. tiny_http for http server. Both work well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: