-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-blocking IO using ES6 generators #4557
Comments
Unfortunately even though ES6 JavaScript would support generators, asm.js doesn't, and we are unable to use the Perhaps if this is interesting, it might be possible to add a codegen mode that does those types of manual mods that you need, although I wonder if it will need to do some kind of dependency propagation for those *s? Also, that would drop support for asm.js. Are you looking to do synchronous stdin keyboard input with C getch() style? That is not yet possible, but with the upcoming synchronous multithreaded filesystem, we will be able to do that. |
Maybe this WebAssembly/design#720 issue is related. |
@mazko Not sure what it does, what should be an input and what should be an output? |
It makes each function between stdin [syscall145, syscall3] ... _main generator function () --> function* () + yield *.
|
This issue has been automatically marked as stale because there has been no activity in the past 2 years. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant. |
Modern browsers already support ES6 generators natively without polyfills. Example (tested on node, firefox, opera, chrome):
Lets try rewrite this to EMCC:
test.c
pre.js
After compilation
emcc --pre-js pre.js test.c -s EXPORTED_FUNCTIONS='["_main", "_main_impl"]' -o test.html
i have to do edit manually test.js to declare and use generator specific syntaxfunction * _main_impl()
andyield Module.getch()
. Any ideas / emcc macros ?The text was updated successfully, but these errors were encountered: