Re: Re: One-shot Delimited Continuations with Effect Handlers

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Re: One-shot Delimited Continuations with Effect Handlers

Bruno Macabeus
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
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Re: One-shot Delimited Continuations with Effect Handlers

kai zhu
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 <[hidden email]> 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
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss

_______________________________________________
es-discuss mailing list
[hidden email]
https://mail.mozilla.org/listinfo/es-discuss