Proposal for porting D runtime to WebAssembly

Georgi D georgid at outlook.com
Mon Nov 25 13:50:20 UTC 2019


On Saturday, 23 November 2019 at 23:21:49 UTC, Nick Sabalausky 
(Abscissa) wrote:
> On 11/23/19 3:48 PM, Sebastiaan Koppe wrote:
>> On Saturday, 23 November 2019 at 15:23:41 UTC, Alexandru 
>> Ermicioi wrote:
>>>
>>> I was wondering whats your position on Fibers?
>> 
>> I am not going to support them in this initial port. And to be

> I did started working on a couple DIPs for them, though. 
> Interestingly, I just found out today about C++'s proposed 
> coroutines and was shocked by how similar they are to what I 
> was designing; even right down to details like how the 
> existence of a yield instruction is what triggers the compiler 
> to treat the function as a coroutine, and the requirement that 
> a coroutine's return type be a special type that includes the 
> state information.
>
> Still, a few differences, though. For example, unlike the C++ 
> proposal, I'm hoping to avoid the need for additional keywords 
> and heap allocation. And I also started a secondary DIP that 
> builds on the coroutine foundation to make a much cleaner 
> user-experience using the coroutines to generate ranges (what I 
> would expect to be the most common use-case).

Hi Sebastiaan,

If you are looking at the C++ coroutines I would recommend 
looking into the  proposal for "First-class symmetric coroutines 
in C++".

The official paper can be found here: 
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1430r1.pdf

There is also a presentation with some nice animations explaining 
the proposal here:
https://docs.google.com/presentation/d/1B5My9nh-P2HLGI8Dtfm6Q7ZfHD9hJ27kJUgnfA2syv4/edit?usp=sharing

There paper is still in early development, for example the syntax 
has changed since then as well as some other pieces.

If you are interested I can connect you with the author of the 
paper who can explain it with more details.

Georgi







More information about the Digitalmars-d-announce mailing list