Python has become a staple language for many applications, from the web to data science. However, Python itself is an interpreted language and is famously quite slow—which is why it integrates well with much faster C code. Many well-liked libraries are implemented in C/C++ and Cython (https://cython.org/) in order to achieve the required performance (for example, numpy, pandas, keras, and PyTorch are largely native code). Since Rust produces native binaries as well, let's look at how we can write Rust modules for Python.
Using Rust and Python
Getting ready
We will work on creating an SHA256 digest again and will use the same folder structure as we have in every recipe in this chapter. Create a python-rust directory...