On Monday, 23 October 2017 at 15:21:02 UTC, Kagamin wrote:
On Friday, 20 October 2017 at 09:49:34 UTC, Adam Wilson wrote:
Others are less obvious, for example, async/await is syntax
sugar for a collection of Task-based idioms in C#.
Now I think it's doesn't fit D. async/await wasn't made for
performance, but for conservation of thread resources, async
calls are rather expensive, which doesn't fit in D if we prefer
raw performance. Also I found another shortcoming: it doesn't
interoperate well with cache: cache flip flops between
synchronous and asynchronous operation: when you hit cache it's
synchronous, when you miss it it performs IO.
Actually, async/await should be faster and safer than running
same blocking code in another thread and then syncing between
them.
If we want to use D for GUI development we will need this feature
anyway. It's the easiest solution how to run blocking functions
in GUI callback without freezing, it reduces bugs and callback
hell. Look at Javascript and Node.js (I think).