Comments (4)
We specifically reserved await
at top-level in modules to account for this possibility. Nobody's had the time to really figure out the semantics yet, though.
from proposal-async-await.
Oh, cool, thank's for the response.
from proposal-async-await.
We're probably not ready for this yet, but for the record there are two solutions that make sense to me:
For server-side systems, it makes sense to me to have a main
function which defines program entry. If the executed module exports a main
function, then it would run that. The main
function could be an async function.
Also, if we ever get do-expressions, then it would makes sense to also have a do-async-expression.
do async {
let x = await a.doStuff();
let y = await a.doOtherStuff(x);
}
My personal opinion is that we should not allow modules themselves to be async, for simplicity and separation of concerns. Also, I don't think we want to outright reject the possibility of a system which loads modules synchronously and doesn't need to worry about async within the module system itself.
from proposal-async-await.
Note that there is also quite a bit of discussion on this same topic in #9.
I'll close this issue to keep a single thread of discussion on top level await.
from proposal-async-await.
Related Issues (20)
- How do you yield* with async/await? HOT 5
- Async arrow functions don't work with default destructed parameters. HOT 1
- server.asyncawait.js uses `await*` syntax
- Question: 'await' is a keyword? HOT 3
- Proposal: parallelize consecutive awaits HOT 4
- Play sounds when messages are received by both admins and users HOT 1
- Clarify the relationship between loops and async HOT 5
- Error in javascript discord bot HOT 1
- A question about async await with native promise. HOT 7
- Spec example needs a tiny fix. HOT 2
- await in spawn HOT 1
- New syntax HOT 1
- > > Btw, what's the case of exporting async function atm? Can't imagine a single one, even if it's a valid syntax. HOT 2
- node google spreadsheet i want to fetch a particular cell HOT 1
- async
- Forbidden Extensions (16.2) should apply to async functions, as they do to Generators HOT 1
- NOTE 1 for Async Function Definitions says different things than rules HOT 1
- Update of "State of this proposal" pharagraph in https://tc39.github.io/ecmascript-asyncawait/ HOT 8
- Throw if ClassHeritage is an async function! HOT 1
- Exceptions swallowed by design? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proposal-async-await.