Proof of Concept of Rust in CPython #11
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a plausible approach for introducing Rust as an optional build dependency for CPython. A few changes are necessary to accomplish this:
Modules/cpython-sys. This isn't super well integrated into the Makefile right now. It requires runningmake regen-rust-wrapper-hto generate the wrapper first, then you can run make normally._base64is added, which has a single functionstandard_b64encodeThere are also a lot of other caveats and limitations. I tested this with gcc and clang on a Linux system, with a GIL-ful build. There's no Mac or Windows support yet, or support for other platforms, but I believe Mac WASI Android and iOS may not be too hard since they share the same build system as Linux..
Windows will require a different approach. I'm not sure yet on how exactly we should do that.
Rough series of commands to get things working:
Install Rust and make sure
cargois available.