-
-
Notifications
You must be signed in to change notification settings - Fork 670
Async main and compileString #419
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
Conversation
I think that something like this is what we'd ultimately want, yeah. One thing to keep in mind is that compilation must still remain deterministic, i.e. even when (here: just mentioning) loading multiple files at once asynchronously, make sure that compilation (not necessarily parsing) order remains the same. Ofc we'll also have to make sure that nothing breaks (looking at you, WebAssembly Studio) when merging such changes. |
import objects now can have hocks for setting up the host
Now the pointer of the module returns is wrapped like Parser. Also need to include dist because current master causes compile error.
Now an abstract class makes creating an import object much easier.
compiler adds RefType returned to end of function names. Loader uses this to wrap returned value. *.d.ts generated also now uses ref types
And cleaned up print statements.
058d6a5
to
b8307f0
Compare
@MaxGraey I think this would be very nice to have, cause e.g. would help http://studio.nearprotocol.com/ to load modules from npm directly vs having to copy them into project, etc. |
Closing this PR as part of 2020 vacuum as it seems to be outdated and makes quite a few unrelated changes that add 10k lines of code. I agree however that |
This makes the main function asynchronous allowing imported readFile/writeFile to be asynchronous. Also added a test for compileString.
I'm not sure if this is the correct way to go about it since it will be breaking for any code that calls main directly, but I thought I'd give it a try to see how it could be done.