Swift is getting async, structured concurrency and actors

Paulo Pinto pjmlp at progtools.org
Sun Dec 13 15:49:47 UTC 2020


On Sunday, 13 December 2020 at 15:18:53 UTC, Sebastiaan Koppe 
wrote:
> On Sunday, 13 December 2020 at 09:55:29 UTC, Ola Fosheim 
> Grostad wrote:
>> On Saturday, 12 December 2020 at 10:14:20 UTC, Sebastiaan 
>> Koppe wrote:
>>> Are they stackless? Then yes.
>>
>> AFAIK conceptually, but maybe the current backend have to save 
>> some state from the top frames and reconstruct it on resume? 
>> Not sure if current LLVM can support fully stackless, but I 
>> haven't checked.
>
> I just did and from a cursory glance they are. Of course they 
> need to allocate whenever they suspend from anything but the 
> top-level, but most compilers elide that when it can proof the 
> coroutine doesn't escape the calling function.
>
> If we do want coroutines, we should just steal it all, it is 
> pretty great work.

If you want to bring that into D I advise many of the great talks 
done by Gor Nishanov, one of the main contributors to the 
co-routines design, for example

“C++ Coroutines: Under the covers"

https://www.youtube.com/watch?v=8C8NnE1Dg4A


More information about the Digitalmars-d mailing list