Replies: 8 comments 4 replies
-
I'll have a go at this - honestly I've always been very curious as to how the more exotic async stuff is actually implemented so this should be interesting. |
Beta Was this translation helpful? Give feedback.
-
Once this is implemented we will also need to setup benchmark(s) for async operations |
Beta Was this translation helpful? Give feedback.
-
Most of the asynchronous stuff happens at runtime level rather than engine level. V8 doesn’t handle the event loop, Node does. I think after parse we’ll need to look at how it integrates in other engines. JS in its pure form doesn’t have anything that’s async, setTimeout is injected in for e.g |
Beta Was this translation helpful? Give feedback.
-
Interesting - I will need to look into this - what is the scope of boa, are we going to implement an event-loop system? |
Beta Was this translation helpful? Give feedback.
-
I think we could provide a default and very limited BTW, any news with the parsing, @Lan2u? |
Beta Was this translation helpful? Give feedback.
-
Yeah, I think that's a good move so we can get stuff tested. Parsing wise I'll try and get the branch ready for review/merge by the end of the week so we can get started on an event_loop (which should be a separate issue I think) |
Beta Was this translation helpful? Give feedback.
-
I have created a project to keep track of this: https://github.com/boa-dev/boa/projects/3 |
Beta Was this translation helpful? Give feedback.
-
Closing, already implemented. |
Beta Was this translation helpful? Give feedback.
-
ECMASCript feature
We currently have no support for
async
/await
in Boa. These two keywords are used to create "promises" that will be executed asynchronously, without blocking the execution of the code that follows.There are two types of
async
constructs:Implementing this has to be done in two phases. First we need to be able to parse these
async
constructs, and for that, we will need new AST nodes and new parsers, that will be called when finding theasync
keyword.After the parsing is done, we need to implement the execution. This will be a bit tricky, since we currently just execute the nodes one by one. This means we need to follow the spec in the "Runtime Semantics" for these two constructs, and implement the needed methods.
This might require further talk in #367.
Beta Was this translation helpful? Give feedback.
All reactions