News for hackers. Stuff that matters.
Re:Why asynchronous Rust doesn't work by ntr-- on Wednesday March 10, 2021 @12:44AM (#26408196)
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

Re:Why asynchronous Rust doesn't work by ogoffart on Wednesday March 10, 2021 @03:25AM (#26409078)
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)

Re:Why asynchronous Rust doesn't work by iso8859-1 on Wednesday March 10, 2021 @11:13AM (#26412752)
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.
Re:Why asynchronous Rust doesn't work by iso8859-1 on Wednesday March 10, 2021 @12:52AM (#26408235)
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.
Re:Why asynchronous Rust doesn't work by thijsc on Wednesday March 10, 2021 @01:41AM (#26408501)
Try https://github.com/algesten/ureq, it’s very nice and not async.
Re:Why asynchronous Rust doesn't work by rapsey on Wednesday March 10, 2021 @01:24AM (#26408398)
You can avoid async ecosystem with mio_httpc for http client. tiny_http for http server. Both work well.