Skip to content

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

Closed
wants to merge 57 commits into from

Conversation

willemneal
Copy link
Contributor

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.

@dcodeIO
Copy link
Member

dcodeIO commented Jan 24, 2019

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.

@vgrichina
Copy link

@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.

@dcodeIO
Copy link
Member

dcodeIO commented May 25, 2020

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 main should become properly asynchronous ultimately, and that we should look into it.

@dcodeIO dcodeIO closed this May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants