-
Notifications
You must be signed in to change notification settings - Fork 896
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
Support ahead-of-time compilation #609
base: master
Are you sure you want to change the base?
Conversation
33a7b66
to
2e627af
Compare
Should there be some way to check if the compile time options (such as |
(I'm also not totally convinced that ahead-of-time compilation is the solution to the "pain" of including extra Python files. Arguably, that's a deficiency of the documentation. If you drop them in the |
It may be something people are looking for, it doesn't break anything in our default workflow does it? |
@rixner - absolutely. Ahead-of-time compilation is not the solution to the pain of bundling extra python files - (And it is a pain - right now the only way to add them to the build is to either copy them into the Skulpt source tree(!!), or roll your own Should I separate out AOT compilation from |
Adds two commands:
compile
(which compiles a single .py file to a .js file that's ready to load), andcompileall
(compiles a directory of mixed .py/.js files into a JS file that adds its contents toSk.builtinFiles.files
, likeskulpt-stdlib.js
does).This PR also adds a default
Sk.read()
implementation that usesSk.builtinFiles.files
, so as long as you've includedskulpt.js
andskulpt-stdlib-js
(plus any additional JS files you've generated with./m compileall
), module loading will work out-of-the-box.This should help address complaints about how much of a pain it is to include extra Python modules in your Skulpt environment (eg issue #554, arguably #601, the underlying problem behind PR #606...)