Skip to content

Javascript Take II #4485

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 3 commits into from
Closed

Javascript Take II #4485

wants to merge 3 commits into from

Conversation

wolfv
Copy link
Contributor

@wolfv wolfv commented Feb 10, 2019

I saw the MicroPython JS port from roughly a year ago (#3575).
It did not immediately compile, and the async loading of Emscripten wasn't properly taken care of (needed some fixing in wrapper.js).

I applied the suggestions in the thread, and fixed wrapper.js so that it loads the bytecode correctly and only executes C-functions after "onRuntimeInitialized".

Please let me know if anything else is necessary to merge this excellent feature (all credit to @flowergrass !)

I'm looking at ways to also precompile Python to bytecode, and hook it up to micro python.

@pfalcon
Copy link
Contributor

pfalcon commented Feb 23, 2019

@wolfv, I'd siggest to search and go over existing tickets/PRs related to JavaScript port, and post links to this PR, because likely many people interested in that stuff are not aware of this new development.

@dpgeorge
Copy link
Member

Thanks @wolfv for picking this up. I'm happy to merge this now, except for one item: what was your reason to remove the JSBackend.patch file? AFAIK it's still needed, and also referenced from the README.md (with explanation on why it's needed).

@wolfv
Copy link
Contributor Author

wolfv commented Mar 13, 2019

@dpgeorge you're right! I just reverted removing the patch. I also checked, and it does seem like a useful patch (even though I did not have to apply it for my simple tests).

It would be great if this was merged. I have some additional features that I would put in a next PR. (e.g. a javascript module that allows eval-ing JS code from MicroPython,

@dpgeorge
Copy link
Member

@wolfv in your single commit there are 2 lines in extmod/moduselect.c that are changed. These should go in a separate commit to be able to more easily track changes to the core and ports separately. I can do this myself during the merge of this PR (the commit would be authored by me, but I'd acknowledge you in the commit message), or you can split it out yourself here in this PR (so there'd be 3 commits in total in this PR). Let me know what you'd prefer.

@wolfv
Copy link
Contributor Author

wolfv commented Mar 13, 2019

I'll remove it from this PR, check if it still builds fine, and then create a seperate PR.

@wolfv
Copy link
Contributor Author

wolfv commented Mar 13, 2019

I had to remove -Werror -Wall flags from the CCFLAGS but then it still builds. Will open another PR.

@wolfv
Copy link
Contributor Author

wolfv commented Mar 13, 2019

opened a seperate PR #4601

@dpgeorge
Copy link
Member

I guess this is good to go in now that #4601 is merged?

@wolfv
Copy link
Contributor Author

wolfv commented Mar 13, 2019

I could re-add the warning flags? otherwise, yes!

@wolfv
Copy link
Contributor Author

wolfv commented Mar 13, 2019

i think it's fine to merge as-is, I will open a next PR with more features and re-add the flags there.

@dpgeorge
Copy link
Member

I could re-add the warning flags?

Yes, it would be best not to remove them, so please undo that change.

@wolfv
Copy link
Contributor Author

wolfv commented Mar 13, 2019

done and rebased.

@dpgeorge
Copy link
Member

Thank you very much! Merged in 7d675f3 and ea2fcdd

@dpgeorge dpgeorge closed this Mar 13, 2019
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.

3 participants