GithubHelp home page GithubHelp logo

Comments (4)

ljharb avatar ljharb commented on May 24, 2024 3

How would you suggest the engine be statically able to know that asyncOne does not depend on anything in asyncTwo? Here, await is statically indicating that it does depend on it.

from proposal-async-await.

ljharb avatar ljharb commented on May 24, 2024 2

Note that this isn't just "late stage", this is finished - ie, stage 4.

Syntactic sugar for await Promise.all(…) existed very early in this proposal, but was largely rejected, as I understand it (await*)

from proposal-async-await.

wheresrhys avatar wheresrhys commented on May 24, 2024

After giving it more thought I realised that this change could break existing code (as asyncTwo could expect some external value to be changed by asyncOne)... so for that reason I doubt this is worth considering for such a late stage proposal. Also, you're right that the static analysis is tricky as asyncOne could dynamically choose external values to change at runtime.

Perhaps there would be scope for an additional keyword which means 'await in parallel', and which allows the developer to specify which Promises can be awaited in parallel. Which would be little more than syntactic sugar around await Promise.all(), but would contribute to the sync/async symmetry that async/await aims towards.

from proposal-async-await.

qfox avatar qfox commented on May 24, 2024

Syntactic sugar for await Promise.all(…) existed very early in this proposal, but was largely rejected, as I understand it (await*)

Yep, exactly.

from proposal-async-await.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.