Hacker News new | ask | show | jobs
by bobvarioa 696 days ago
Contributor for Porffor here! I think this is a great comparison, but Porffor does technically support promises, albeit synchronously. It's a similar approach to Kiesel, https://kiesel.dev/.
1 comments

Not sure where you mean by synchronously but if you mean what I think you mean then that is not correct behaviour. This is important to ensure predicatibility.

Eg.

    Promise.then(() => console.log(“a”));
    console.log(“b”)
must log [“b”, “a”] and not [“a”, “b”].
This type of test does work as expected. The "sync" means that it does not feature a full event loop (yet) so cannot easily support async I/O or some more "advanced" use cases.
There's a WASI async functions proposal I think? Are you looking at supporting that so you don't have to bring your own event loop?
JavaScript doesn’t make the guarantee you are claiming here
Yes, it does. Promise continuations always run in the micro task queue per the standard. I guess if someone mutates the promise prototype it’s not guaranteed, but the spec does guarantee this order
What do you mean? Does JavaScript allow the `then` of a promise to execute before the contents of the promise?