Streaming parsers in D a novel design
Dmitry Olshansky
dmitry.olsh at gmail.com
Tue Apr 18 16:09:23 UTC 2023
On Tuesday, 18 April 2023 at 14:26:00 UTC, Sebastiaan Koppe wrote:
> On Tuesday, 18 April 2023 at 08:13:05 UTC, Dmitry Olshansky
> wrote:
>> A streaming parser is doing 2 things:
>> - waiting for input
>> - processing the current input and spitting out Events
>>
>> This maps to D beautifully:
>>
>> 1. Waiting for input means it's an OutputRange with explicit
>> put method!
>>
>> 2. Processing events means it's an InputRange of events. It
>> may even be ForwardRange, mine first of this kind is Forward
>> range.
>>
>> Destroy!
>>
>> --
>> Olshansky Dmitry
>
> I think it will work beautifully until the day you want to do
> it asynchronously.
Photon takes care of that:
https://github.com/DmitryOlshansky/photon
More information about the Digitalmars-d
mailing list