How to Create Rust Python Bindings (opens in new tab)
Rust is super fast. Python is super flexible. Porting slow python code to rust can make your life a lot easier, and it’s not too difficult to set up. I will demonstrate rust bindings for summing the integers in a large text file containing a billion digits that looks like 6,9,8,3,0,1,8,4,9,7,6,3,4,2,6,0,0,5,1,1, . . . ,4,5,9,3,3,2,8,3 General steps install rust and maturin set up boilerplate add your function compile and import Install Rust and Maturin curl --proto '=https' --tlsv1.2 -sSf | s...
Read the original article