Streaming parsers in D a novel design

Sebastiaan Koppe mail at skoppe.eu
Fri Apr 21 06:54:28 UTC 2023


On Thursday, 20 April 2023 at 00:17:05 UTC, Dmitry Olshansky 
wrote:
> I think your structured concurrency stuff would fit nicely in 
> photon, maybe we should get in touch and discuss it.

I actually considered going with photon before starting to 
implement C++'s Senders/Receivers.

Its an awesome idea, but what held me back was the portability 
concerns around fibers. WebAssembly doesn't support them for 
instance.

We also needed support for async algorithms. Racing TCP 
connections is a classic example, where you initiate  2 
connections in parallel and continue with whoever responds first. 
Key is doing that in a structured way, so there is no possibility 
of leaking something.

There is probably a way we could integrate the 2 libs, I already 
have a MR for supporting D fibers, so we can probably extend it 
to whatever executor photon has.

I bet there is a way to autowrap any regular blocking libraries 
that way, and get both structured concurrency and async syscalls. 
Interesting.


More information about the Digitalmars-d mailing list