One-shot Delimited Continuations with Effect Handlers

kai zhu kaizhu256 at gmail.com
Wed Dec 25 19:23:21 UTC 2019


the usage-scenario is not compelling.
the same effect can be achieved in 12-lines of throwaway-code (i copy
pasted into console), with less tech-debt:

$ node -e '
var nameList = [null, "Gendry"];
nameList.forEach(async function (name) {
    // if name is null, then wait 1000ms, and default to "Arya Stark"
    if (name === null) {
        await new Promise(function (resolve) {
            setTimeout(resolve, 1000);
        });
        name = "Arya Stark";
    }
    var nameUpperCase = name.toUpperCase();
    console.log(nameUpperCase);
});
'
$ GENDRY
$ ARYA STARK



On Tue, Dec 24, 2019 at 4:41 AM Bruno Macabeus <bruno.macabeus at gmail.com>
wrote:

> Hello for all,
>
> I know that this discuss is a little old, but I just found it now and I
> think that it is still useful at this moment.
>
> So I created a very simple Babel plugin to taste and validate the
> Sebatian's idea: https://github.com/macabeus/js-proposal-algebraic-effects
> Maybe it could be useful to test how much this proposal could be useful
> for our JS code.
>
> Algebraic Effects/One-shot delimited continuations/effect handlers are
> viable proposals?
>
> Thank you!
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20191225/9cdbadf6/attachment.html>


More information about the es-discuss mailing list