3 ms·
Depending on your current language, I might recommend Rust because it integrates really well for writing high-performance extension modules for other languages.
by vgel 4y ago
Depending on your current language, I might recommend Rust because it integrates really well for writing high-performance extension modules for other languages.
For example at $WORK we're slowly rewriting our entire data processing pipeline in Rust, but for awhile we've had a hybrid Rust / Python setup using PyO3, which makes it really easy to build your Rust code into a shared library and call it from Python, with the entire API specified declaratively using derive macros and the GIL handled for you using typestate tokens. Really cool stuff.
- a4a4a4a4 4y agoHow do you handle deploying the rust code that's embedded in your python code? Do you have multiple deployment targets for the code (mac, linux, windows)? This is the sticking point for me with embedding rust into my python projects.
- kylebarron 4y agoBuild Python wheels on CI with the statically-linked Rust binary?
- vgel 4y agoWe use Maturin to build. You can either build manylinux / Windows / OSX wheels and upload them to PyPI / your preferred distribution method, or easier, use `maturin develop` to build and install a wheel into the currently-active virtualenv.