Async-await on stable Rust!

rikki cattermole rikki at cattermole.co.nz
Fri Nov 8 15:27:44 UTC 2019


On 09/11/2019 4:11 AM, Sebastiaan Koppe wrote:
> On Friday, 8 November 2019 at 14:28:36 UTC, rikki cattermole wrote:
>> On 09/11/2019 2:24 AM, Sebastiaan Koppe wrote:
>>> What does 'ready to execute' mean? And why synchronously? isn't the 
>>> idea of async to run concurrently?
>>
>> So ready to execute could mean that a socket has data in the buffer 
>> ready to be read.
> 
> Ah, you mean after it first yielded.

That's one way to do it, yes.
You may not want to wrap it in a fiber though.
That can be a bit costly if you don't need it.

But that is a decision that the language does not need to make luckily.
It can be made by the compiler hook implementation and what library its 
hooking the closure creation into.

>> In other words, I don't want this behavior baked into the language. 
>> That seems like a good way to have regrets that we can't fix easily.
> 
> I am not so sure, good concurrency seems to require a little help from 
> the compiler.

 From what I've read over the years, nobody seems to have any compelling 
solution to concurrency. Its a hard problem to solve, at least in the 
general case.
That is why I don't like the idea of baking one model into the language. 
It probably won't work for a lot of people, assuming it works as advertised.


More information about the Digitalmars-d mailing list