My two cents

bitwise bitwise.pvt at gmail.com
Sat Oct 21 18:52:15 UTC 2017


On Wednesday, 18 October 2017 at 08:56:21 UTC, Satoshi wrote:

> async/await (vibe.d is nice but useless in comparison to C# or 
> js async/await idiom)


> Reference counting when we cannot use GC...


If I understand correctly, both of these depend on implementation 
of 'scope' which is being worked on right now.

I think reference counting needs 'scope' to be made safe. RC also 
benefits from scope in that many of the increments/decrements of 
the ref count can be elided. The performance gain can be 
significant, and even more so when you use atomic reference 
counting (like C++ shared_ptr) for thread safety.

Async/Await needs to allocate state for the function's local 
variables. When it's detected that the function's 
state/enumerator won't escape it's current scope, it can be put 
on the stack, which is a pretty big optimization.

I should also note that, RC has been formally acknowledged as a 
future goal of D, but as far as I know, async/await has not.






More information about the Digitalmars-d mailing list