News for hackers. Stuff that matters.
Re:Tokio 1.0 – async runtime for Rust by steveklabnik on Wednesday December 23, 2020 @04:42PM (#25522558)
Async/await matters in Rust specifically because the borrow checker makes writing code without it difficult, inefficient, and unergonomic: http://aturon.github.io/tech/2018/04/24/async-borrowing/ (note that some of the details have changed here, but the thrust of it is very much the same.)

That said, if you can get your job done without this stuff, that's fine too, but the reasons it was pursued specifically involve the above.

Re:Tokio 1.0 – async runtime for Rust by simias on Wednesday December 23, 2020 @05:51PM (#25523207)
Ah that's a good point, it's true that the borrow checker can sometimes get in the way for event-driven architectures and async IO borrows.

That being said I can't shake the feeling that going for something like Tokio in such a case is a bit like healing a paper cut by amputating the arm. Sure, technically you don't have the original problem anymore...

Re:Tokio 1.0 – async runtime for Rust by jgilias on Wednesday December 23, 2020 @06:23PM (#25523462)
Can you elaborate a bit what it is that you find difficult or undesirable about Tokio? Or async/await + some runtime in general?

So, I can relate to not wanting to pull in the dependency. But otherwise it seems pretty straightforward to me. You just macro-decorate the main function, sprinkle some async/await around, maybe add a join or a mutex somewhere, and then pretty much forget all about event loops, messaging, threads and whatnot. I feel like I must be missing something important here.

Re:Tokio 1.0 – async runtime for Rust by jstrong on Thursday December 24, 2020 @02:09AM (#25525608)
> just macro-decorate the main function, sprinkle some async/await around, maybe add a join or a mutex somewhere, and then pretty much forget all about event loops, messaging, threads and whatnot

that is ... not how I have experienced it. I work on building highly concurrent systems every day but async drives me insane. to me the fundamental issue is that although the code now reads linearly, it no longer executes linearly (or reasonably close to linearly), which is 1000x more confusing.

the other thing, when I'm using rust to build something high performance, part of the reason is it provides greater control. I just can't square that with macro-decorating my main function, and handing over the core control-flow to someone else's runtime.

Re:Tokio 1.0 – async runtime for Rust by jgilias on Thursday December 24, 2020 @03:22AM (#25525921)
Thank you for the perspective! This actually explains it very well. So, in a nutshell, it's the difference between apparent and actual complexity, as well as a trust issue.

With async/await the apparent complexity gets reduced at the cost of vastly increased actual complexity. E.g., now instead of everything being your code that you can look at and reason about, all your concurrent workloads disappear in this void that promises to do the right thing with them. If it works the way you intended, great. If it doesn't, the rabbit hole can now be really deep.

And then, it's also a trust issue. Now you have to trust other people to have done a good job.

Ok, yes, this makes sense.

Re:Tokio 1.0 – async runtime for Rust by simias on Thursday December 24, 2020 @08:17PM (#25533306)
You answered jgilias better than I could, I feel exactly the same way. Async is deceptively simple in my opinion, because while it looks arguably even simpler than an explicit state machine, it makes your program flow nonlinear and I find that a lot harder to work with. With blocking code I can mentally step through the code follow causes and consequences easily, with async I feel like I'm watching a scifi movie involving time travel and parallel universes.

And the loss of control is also an issue for me. I write code for memory-constrained environments, with blocking code and OS threads I can usually bound my memory consumption fairly easily. If I surrender the control to a scheduler runtime I feel like it becomes a lot harder, although here I'm willing to concede that it might have more to do with my lack of experience with Tokio than an objective issue.

Re:Tokio 1.0 – async runtime for Rust by jstrong on Friday January 01, 2021 @04:52AM (#25602085)
agree 100%. it honestly kind of baffles me, "async" is like the programming community's white whale, and all of us get to come along for the chase. meanwhile, I long ago grew accustomed to the paradigm of an "event loop" in my programs. after a certain point it becomes very natural. on the subject of memory, recently there was an issue where the async dyn futures were blowing up stacks because a resolved future was > 2mb - what!? I mean, look at the signatures in the aturon article - we are going from this

    fn read(&mut self, buf: &mut [u8]) -> Result<usize, io::Error>
... to this ...

    fn read<T: AsMut<[u8]>>(self, buf: T) ->
        impl Future<Item = (Self, T, usize), Error = (Self, T, io::Error)>
is that supposed to be easier?

I recently tried writing a small program that would manually poll a future to get a feel for it - utter disaster. conflicting versions of tokio, compiles but crashes because something is called outside of the tokio runtime context, etc. all the examples have #[tokio::main]-decorated main - it's like, I'm not giving you my #$(&#@(&ing main function! the programs I write have tons of stuff going on! I can't just give some library my entire control flow!

sorry for the rant! felt good to write it though.

Re:Tokio 1.0 – async runtime for Rust by ldng on Wednesday December 23, 2020 @09:52PM (#25524640)
I also don't get the async hype.

Maybe it is undesirable because that often times plain mono-thread synchronous is fast enough, easier to read, easier to debug and safe to handle to a junior ? Not everybody in a team has the same level of expertise.

And Rust is not an interpreted language. IMHO, interpreted languages should just drop to a compiled one to keep it KISS. Instead of going the async road, just to discover in production, it is unstable because back-pressure was not taken into account. And, in Rust, it is probably not worth the effort and ultimately bloat most of the time.

Re:Tokio 1.0 – async runtime for Rust by lmm on Thursday December 24, 2020 @12:01AM (#25525188)
> Maybe it is undesirable because that often times plain mono-thread synchronous is fast enough, easier to read, easier to debug and safe to handle to a junior ? Not everybody in a team has the same level of expertise.

Shared-memory concurrency is pretty much always buggy, IME, even if your team thinks they're experts.

> And Rust is not an interpreted language. IMHO, interpreted languages should just drop to a compiled one to keep it KISS. Instead of going the async road, just to discover in production, it is unstable because back-pressure was not taken into account.

WTF? Switching to a compiled language doesn't magically make your threads nonblocking. Maybe you can serve 10x more users with a compiled language, but if we're talking about slow network requests then async can make your throughput thousands of times higher.

Re:Tokio 1.0 – async runtime for Rust by ldng on Thursday December 24, 2020 @01:18AM (#25525436)
Why WTF ?

You are reading something I did not write. I am not obsessed with the nonblocking mantra. Blocking is not inherently bad. Multi-processus is also a perfectly valid concurrency model.

Nor am I obsessing about being ultra performant to achieve the revered C10K when I don't need to or can get around it. That was my point.

Not everybody is Facebook or Netflix. For the vast majority of small and medium enterprises, it faster, simpler, safer (and possibly cheaper) to quickly develop a blocking program without thread and spawn multiple processes.

Re:Tokio 1.0 – async runtime for Rust by lmm on Thursday December 24, 2020 @01:40AM (#25525508)
> Why WTF ?

Because WTF does using a compiled language have to do with anything?

> Nor am I obsessing about being ultra performant to achieve the revered C10K when I don't need to or can get around it. That was my point.

Then what is it that you imagine using a compiled language would help with?

Re:Tokio 1.0 – async runtime for Rust by sagichmal on Thursday December 24, 2020 @05:33AM (#25526434)
> Shared-memory concurrency is pretty much always buggy, IME, even if your team thinks they're experts.

Writing bug-free shared memory concurrency programs with Go is trivial. Your opinion is based on outdated information.

Re:Tokio 1.0 – async runtime for Rust by ragnese on Thursday December 24, 2020 @06:20AM (#25526604)
I've definitely written buggy goroutine code before. AMA :p

I vaguely remember expecting a reference and getting a copy or vice versa...

I mean, I agree that Go is miles ahead of most other languages when it comes to helping prevent concurrency bugs, but it's sill tricky. Same with Rust.

Re:Tokio 1.0 – async runtime for Rust by sagichmal on Thursday December 24, 2020 @07:21AM (#25526897)
Go makes concurrency about as tricky as a reasonably complex data structure. can you still write a bug? Of course. Is it so tricky that bugs are inevitable, or even common? Absolutely not.
Re:Tokio 1.0 – async runtime for Rust by lmm on Thursday December 24, 2020 @08:18AM (#25527174)
Go's whole approach to concurrency is about avoiding sharing memory; channels suspend in much the same way as async/await yield points.
Re:Tokio 1.0 – async runtime for Rust by bsaul on Thursday December 24, 2020 @05:47PM (#25532230)
I like go, but i don’t understand your point. Go seems to like passing pointers over channels, which is pretty far from avoiding shared memory. Unless you start writing code that looks like actor based concurrency, with channels used to pass messages acrross actors. But this isn’t what i’d call idiomatic go.
Re:Tokio 1.0 – async runtime for Rust by lmm on Thursday December 24, 2020 @09:09PM (#25533561)
> Unless you start writing code that looks like actor based concurrency, with channels used to pass messages acrross actors. But this isn’t what i’d call idiomatic go.

Isn't that exactly what Go people push? "Don't communicate by sharing memory; share memory by communicating" and all that. If you start pushing pointers to shared memory around then I'd expect all of the problems of traditional multithreading to reappear.

Re:Tokio 1.0 – async runtime for Rust by zozbot234 on Friday December 25, 2020 @10:06AM (#25536847)
Passing pointers to shared memory is highly unsafe in Go. While the Rust borrow checker will prevent all data races, there's nothing like that wrt. Go.
Re:Tokio 1.0 – async runtime for Rust by sagichmal on Friday December 25, 2020 @11:09AM (#25537211)
> Passing pointers to shared memory is highly unsafe in Go. While the Rust borrow checker will prevent all data races, there's nothing like that wrt. Go

Passing pointers to shared memory is the foundation of a huge number of idiomatic, performant, and productive design patterns and architectures. There exist a number of conventions and tools, like the race detector, which reduce the risks of data races to entirely reasonable levels.

Re:Tokio 1.0 – async runtime for Rust by sagichmal on Thursday December 24, 2020 @07:05PM (#25532875)
Passing pointers over channels doesn't necessarily mean you're sharing memory, you could be passing ownership. Pointer or value are both equally idiomatic.
Re:Tokio 1.0 – async runtime for Rust by btrask on Wednesday December 23, 2020 @06:12PM (#25523372)
Wait, what? What happened to "fearless concurrency"? I thought this was supposed to be one of the borrow checker's selling points!

https://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.h...

Re:Tokio 1.0 – async runtime for Rust by steveklabnik on Wednesday December 23, 2020 @06:15PM (#25523390)
I mean, it is, yes. That post is talking about threads. And the “fearless” name meant that it solves a lot of issues at compile time, which it still does in an async context.

Like any static analysis, it’s a give and take between making sure your analysis is sound, while still allowing useful programs.

Re:Tokio 1.0 – async runtime for Rust by btrask on Wednesday December 23, 2020 @06:23PM (#25523457)
Whether it's kernel threads or green threads, the same patterns (locks, etc) are possible. Locks are supposed to be the borrow checker's bread and butter, because it can guarantee they are held before accessing shared state. But now you're saying "the borrow checker makes writing code without [async/await] difficult, inefficient, and unergonomic."

I'm not saying locks are better than async/await (although they are[1]). You're saying the borrow checker itself can't handle them in real world use?

[1] https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...

Re:Tokio 1.0 – async runtime for Rust by steveklabnik on Wednesday December 23, 2020 @06:35PM (#25523540)
I am not saying that the borrow checker cannot handle locks. Locks work great.

(The borrow checker does not understand locks as a special construct, to be extra clear.)

Did you read the post I linked? It lays out the details. I am happy to clarify if you don’t get the specifics.

Re:Tokio 1.0 – async runtime for Rust by btrask on Wednesday December 23, 2020 @06:49PM (#25523651)
I see now, I misunderstood your original post. You were saying async/await is necessary because futures work badly, not because all the alternatives (i.e. locks) work badly.

Sorry, my mistake!

Edit to add: futures work badly in every language, so there's no shame in the borrow checker not working with them.

Edit 2: But in that case we're back to "why would Rust want async/await over (potentially green) threads with its first-class support for locks?"

Re:Tokio 1.0 – async runtime for Rust by dwoot on Wednesday December 23, 2020 @10:55PM (#25524902)
I believe these are the talks from Steve that he's referring to. It was enlightening for me:

1. Rust's Journey to Async/Await - https://www.youtube.com/watch?v=lJ3NC-R3gSI

2. The Talk You've been Await-ing for - https://www.youtube.com/watch?v=NNwK5ZPAJCk

The first video goes into all the bits you're concerned about and all the things that Rust has tried before arriving where they are now

Re:Tokio 1.0 – async runtime for Rust by ragnese on Thursday December 24, 2020 @06:26AM (#25526629)
Language support for green threads require a heavier runtime (so you'd pay the performance cost even when you didn't write async code).

Tokio basically is green threads as a library.

Re:Tokio 1.0 – async runtime for Rust by steveklabnik on Wednesday December 23, 2020 @07:05PM (#25523760)
Regarding your edit 2, I linked two talks I have that go over this in great detail elsewhere in this thread.
Re:Tokio 1.0 – async runtime for Rust by sanxiyn on Wednesday December 23, 2020 @06:30PM (#25523510)
Yes. There are some difficult technical issues. In practice, borrow checker works less well on async code than threaded code.

This is partly why I prefer threading over async in Rust. Look, we went through some enormous effort to make threading good and fun again. Why wouldn't you use threading?

Re:Tokio 1.0 – async runtime for Rust by jen20 on Wednesday December 23, 2020 @06:50PM (#25523658)
> Why wouldn't you use threading?

Because the C10^nK problem where n increases periodically is still a thing?

Re:Tokio 1.0 – async runtime for Rust by sanxiyn on Wednesday December 23, 2020 @07:07PM (#25523778)
I am not solving C10K problem.
Re:Tokio 1.0 – async runtime for Rust by btrask on Wednesday December 23, 2020 @06:54PM (#25523684)
Green threads.
Re:Tokio 1.0 – async runtime for Rust by coolreader18 on Wednesday December 23, 2020 @07:22PM (#25523883)
Those are async tasks

Or rather -- async tasks are as close as you can get to green threads in rust without a runtime that would impose overhead on every program

Re:Tokio 1.0 – async runtime for Rust by darthrupert on Thursday December 24, 2020 @12:39AM (#25525312)
Because you cannot win artificial benchmarks with threading.
Re:Tokio 1.0 – async runtime for Rust by timClicks on Wednesday December 23, 2020 @06:18PM (#25523413)
It's still fearless, as in you don't need to worry that you might create data races, but can be clunky to write in some cases.
Re:Tokio 1.0 – async runtime for Rust by mratsim on Thursday December 24, 2020 @11:01AM (#25528615)
If the borrow checker has no representation of a memory model, for example relaxed/acquire/release, you can't write a concurrent queue without triple checking for statement ordering, resulting barriers and then formally verify it otherwise you are very likely to introduce data races.
Re:Tokio 1.0 – async runtime for Rust by steveklabnik on Thursday December 24, 2020 @06:32PM (#25532612)
The borrow checker doesn’t understand orderings, as it doesn’t specifically need to. You can get race conditions, but not data races. Yes, you need to be careful when writing this kind of code.
Re:Tokio 1.0 – async runtime for Rust by sanxiyn on Wednesday December 23, 2020 @04:46PM (#25522608)
It all comes down to "is it such a common scenario?". Honest answer is no. async is for specialized situations and shouldn't be the default.
Re:Tokio 1.0 – async runtime for Rust by jandrewrogers on Wednesday December 23, 2020 @06:45PM (#25523624)
Rust is a systems programming language. Modern server software -- a primary use case for a systems language -- is heavily async by default for a long list of compelling architectural reasons. Providing first-class language tooling to support that seems eminently sensible since this is how people will want to use the language.

When you are writing high-performance server code, async is the common scenario.

Re:Tokio 1.0 – async runtime for Rust by steveklabnik on Wednesday December 23, 2020 @04:48PM (#25522623)
Depending on the kind of work you're doing, it may or may not be. If you're doing a lot of network IO, then yes, it is very common.
Re:Tokio 1.0 – async runtime for Rust by ibraheemdev on Wednesday December 23, 2020 @04:51PM (#25522653)
async is not the default. The standard library is 100% blocking, and Rust does not come with a runtime. However, async makes sense for a lot of people, which is why libraries like tokio and async-std are so popular.
Re:Tokio 1.0 – async runtime for Rust by sanxiyn on Wednesday December 23, 2020 @04:54PM (#25522687)
async does not make sense for a lot of people and I am deeply worried by hype-driven popularity of Tokio and async-std in Rust.

Especially harmful is that common libraries like reqwest (for HTTP requests) pulls async.

Re:Tokio 1.0 – async runtime for Rust by nemothekid on Wednesday December 23, 2020 @05:10PM (#25522850)
Web servers are the quintessential product of async. It’s no surprise that for an industry dominated by web titans spend a lot of time writing web servers and have a huge interest in asynchronous processing. The importance of a sync was cemented way back in 1999 with the c10k problem with nginx vs Apache.
Re:Tokio 1.0 – async runtime for Rust by sanxiyn on Wednesday December 23, 2020 @05:14PM (#25522881)
Most people are not writing the next nginx. They are writing web application servers behind nginx.
Re:Tokio 1.0 – async runtime for Rust by austinshea on Wednesday December 23, 2020 @05:18PM (#25522926)
This, merely, means that the web application code will hold back what Nginx is capable of serving.
Re:Tokio 1.0 – async runtime for Rust by pvorb on Wednesday December 23, 2020 @05:46PM (#25523170)
If you know that there will be 10k concurrent users in your application, go ahead and use async right from the start.

But for the rest of us, simple, blocking code will do just fine and save us a few headaches.

Re:Tokio 1.0 – async runtime for Rust by nicoburns on Wednesday December 23, 2020 @06:25PM (#25523472)
Alternatively use async everywhere from the start and your headaches go away too. It's mixing blocking code with async code that causes issues.
Re:Tokio 1.0 – async runtime for Rust by pvorb on Wednesday December 23, 2020 @07:08PM (#25523788)
Just do it if everyone in your team is comfortable with it. I'm just not as productive with async code.
Re:Tokio 1.0 – async runtime for Rust by nicoburns on Wednesday December 23, 2020 @07:57PM (#25524104)
Ah yeah, as someone whose first langauge is javascript where all IO and even things like timers are async, I forget that not everyone groks it. It's really not that complicated (at work we have junior devs with 6 months experience writing async code no problem), but I think there is a certain amount of unlearning that needs to be done if you're used to working with threaded code.
Re:Tokio 1.0 – async runtime for Rust by lumost on Wednesday December 23, 2020 @07:18PM (#25523857)
won't this just bifurcate the rust ecosystem between async and non-async rust libraries?
Re:Tokio 1.0 – async runtime for Rust by loeg on Wednesday December 23, 2020 @11:19PM (#25525022)
It's already there.
Re:Tokio 1.0 – async runtime for Rust by sagichmal on Thursday December 24, 2020 @05:37AM (#25526446)
You underestimate how common this use case is. It motivates the Go language, which is much more widely used than Rust.
Re:Tokio 1.0 – async runtime for Rust by nemothekid on Wednesday December 23, 2020 @08:36PM (#25524323)
>But for the rest of us, simple, blocking code will do just fine and save us a few headaches.

I understand your point, but if performance isn't a concern, why use Rust at all? If the intricacies of async is that much of a burden then Rust is probably not the right tool of the job.

Re:Tokio 1.0 – async runtime for Rust by pvorb on Wednesday December 23, 2020 @06:14PM (#25523386)
And once you get to a limit, the alternative to rewriting everything in non-blocking code might be to put multiple instances of your blocking app on multiple VMs/k8s/whatever behind a load balancer.
Re:Tokio 1.0 – async runtime for Rust by nchi3 on Wednesday December 23, 2020 @06:42PM (#25523596)
Or, you just take the initial leap and write async from the start. For languages with decent abstractions such as async/await, it really isn't hard when you've done it for a while, and I'd make the same argument as one of the parent posters in that it's great "documentation".

K8s is brings way more complexity and headache, so it's kind of funny that you suggest that before using async/await.

Re:Tokio 1.0 – async runtime for Rust by da39a3ee on Thursday December 24, 2020 @02:13AM (#25525629)
> For languages with decent abstractions such as async/await, it really isn't hard when you've done it for a while

https://lucumr.pocoo.org/2016/10/30/i-dont-understand-asynci...

Re:Tokio 1.0 – async runtime for Rust by nchi3 on Friday December 25, 2020 @10:14AM (#25536885)
I haven't used async in Python, but I'd bet you don't really _need_ to understand every single one of those concepts, unless you're developing something very niche and low level (or an interpreter). If you do need to know it, I'd argue that it's not a great abstraction; you definitely don't need to know that implementation details and concepts in either C# or Rust to use async/await.
Re:Tokio 1.0 – async runtime for Rust by lallysingh on Wednesday December 23, 2020 @11:56PM (#25525160)
Setting up k8s once solves the problem for all your apps. In contrast, the additional software complexity of async/await is duplicated across all of them.

If your planning to scale up, k8s is likely something you'll want later. Additional complexity in your apps is not.

Re:Tokio 1.0 – async runtime for Rust by nchi3 on Friday December 25, 2020 @10:20AM (#25536921)
> Additional complexity in your apps is not.

My point was that it really isn't that much additional complexity. 99.9% of the time, the main difference is that you'll have to write "await". You don't really need to know that there's a state machine hiding beneath.

Re:Tokio 1.0 – async runtime for Rust by pvorb on Wednesday December 23, 2020 @07:06PM (#25523776)
You probably shouldn't introduce K8s just to solve that problem. I'm just saying if you're already on k8s, scaling horizontally becomes easy.
Re:Tokio 1.0 – async runtime for Rust by platinumrad on Wednesday December 23, 2020 @05:53PM (#25523227)
Any web application will already be "holding back" Nginx because Nginx doesn't have to do things like database queries...
Re:Tokio 1.0 – async runtime for Rust by secondcoming on Wednesday December 23, 2020 @06:33PM (#25523524)
Maybe in your world!
Re:Tokio 1.0 – async runtime for Rust by sidlls on Wednesday December 23, 2020 @05:08PM (#25522831)
In fairness it's just the announcement of V1 of the library. There doesn't seem to me to be anyone promoting its use "everywhere".

On the other hand, there has been from day one a sort of hype around Rust's safety features, and an eagerness to promote any new library or framework written in Rust as a savior of programming. This library, as you note, will be used inappropriately (i.e. in contexts where it's not really necessary or reasonable to do) and lead to the worst kinds of bugs--those that lurk in complicated, difficult to understand code, and that are generally worse than any memory-related security vulnerability.

Re:Tokio 1.0 – async runtime for Rust by ibraheemdev on Wednesday December 23, 2020 @05:07PM (#25522824)
If you think OS threads are "better" than async tasks, then use them. Other people want to use async, so they use it. Rust does not have a runtime and provides blocking APIs by default, but gives you the option to use async if you want to.
Re:Tokio 1.0 – async runtime for Rust by Scarbutt on Wednesday December 23, 2020 @05:43PM (#25523153)
True, but everyday more and more libraries are getting tedious to use in blocking mode.
Re:Tokio 1.0 – async runtime for Rust by josephg on Wednesday December 23, 2020 @06:32PM (#25523523)
In rust you can block your thread on the completion of an async future. Let other people use async code if they want to, and you can write your code in a syncronous blocking kind of way.
Re:Tokio 1.0 – async runtime for Rust by ksenzee on Wednesday December 23, 2020 @05:02PM (#25522777)
Shouldn't an HTTP request library make async available? HTTP is the textbook example for async.
Re:Tokio 1.0 – async runtime for Rust by sanxiyn on Wednesday December 23, 2020 @05:08PM (#25522840)
It should, but it shouldn't be the default. Right now, reqwest is the default HTTP request library in Rust ecosystem, and async is mandatory for reqwest. This is a bad situation to be in.
Re:Tokio 1.0 – async runtime for Rust by ibraheemdev on Wednesday December 23, 2020 @05:19PM (#25522935)
> async is mandatory for reqwest

async is not mandatory for reqwest. It provides a blocking API as well.

> reqwest is the default HTTP request library in Rust ecosystem

There is no "default" libraries. There are popular HTTP clients other than reqwest that also provide blocking APIs such as isahc and ureq

Re:Tokio 1.0 – async runtime for Rust by sanxiyn on Wednesday December 23, 2020 @05:25PM (#25522987)
reqwest provides a blocking API, but reqwest also always depends on Tokio. A blocking API doesn't help when I don't want Tokio in my dependency tree at all.

I am using isahc, but that also doesn't help when (say) Rusoto AWS library pulls reqwest pulls Tokio pulls async.

Re:Tokio 1.0 – async runtime for Rust by fastball on Wednesday December 23, 2020 @05:46PM (#25523167)
Doesn't sound like a problem with async, just sounds like you disagreeing about what good deps for your deps are.
Re:Tokio 1.0 – async runtime for Rust by eropple on Wednesday December 23, 2020 @07:27PM (#25523920)
Can you explain exactly what that library using Tokio internally exposes to you that's a problem? Because, as written, this sounds like a religious argument.
Re:Tokio 1.0 – async runtime for Rust by therein on Wednesday December 23, 2020 @09:10PM (#25524459)
If you need to use (for the sake of the example) Rusoto, since it is based on tokio, you'll need to set up the Tokio executor or at least add a macro to your main for this to be done for you. I believe Rusoto actually would take care of this for you if you haven't done it yourself however friction arises when you were already using a different version of tokio and Rusoto is built against another.

Basically, it isn't entirely opaque to you how it is handled.

Re:Tokio 1.0 – async runtime for Rust by eropple on Wednesday December 23, 2020 @11:59PM (#25525175)
Gotcha, makes sense. Thanks!
Re:Tokio 1.0 – async runtime for Rust by pm215 on Thursday December 24, 2020 @10:08AM (#25528062)
I had a simple rust program that used reqwest -- it just pulled down a few web pages and parsed some data out of tables in the HTML. At the time reqwest had a simple synchronous API function that made this easy. The version of reqwest which added async support broke compatibility of that function and didn't appear to provide any similarly easy to use equivalent. Luckily my use-case went away (the website I was screen scraping died) so I didn't need to try to actually fix my program to work with newer reqwest versions. But it left a pretty sour taste regarding async...
Re:Tokio 1.0 – async runtime for Rust by nicoburns on Wednesday December 23, 2020 @06:26PM (#25523481)
There's ureq for sync/blocking HTTP requests.
Re:Tokio 1.0 – async runtime for Rust by austinshea on Wednesday December 23, 2020 @05:20PM (#25522939)
Req west? The best.
Re:Tokio 1.0 – async runtime for Rust by austinshea on Wednesday December 23, 2020 @05:17PM (#25522912)
Parallelism is complicated, and it is valuable.