[DGD] Chained continuations and curl

Felix A. Croes felix at dworkin.nl
Mon Sep 24 06:04:07 CEST 2018


nikoroleva <natasha.i.koroleva at gmail.com> wrote:

> I was inspired by the thread on libraries for DGD/Hydra. I look
> forward to more such posts.

Your response provided impetus for some inspiration of my own.

Continuations as implemented are not yet complete; I didn't go beyond
the current implementation because I didn't have a use case for it
yet.  Some thoughts:

 - there is no way yet to start a new continuation that does not
   delay the one currently running.  Something like

    cont->runSeparate();

 - there is no way to pause a continuation and wait for an external
   signal to continue.  This could be used to handle user input, or
   curl output, with a continuation
 - there is no way to have a continuation with a non-zero delay yet


> I completed the first draft of a curl implementation.

It looks like you implemented it as a kfun.  Why not in LPC?


>[...]
> Thoughts about how best to do a curl implementation? How to write a
> better JSON parser in DGD-LPC? How to make the most of the chained
> continuations in this case?

You could use a parse_string implementation for a partial JSON parsing
+ a left-over string of tokens that can only be parsed when more input
is available.  This was previously discussed on the list in the context
of parsing imud data.

Must run; I will post more about this in the next few days.

Regards,
Felix Croes



More information about the DGD mailing list