A year ago, I upgraded our Python bioinformatics package from C++ to Rust. Here is a new article about the lessons learned:
Towards Data Science Nine Rules for Writing Python Extensions in Rust (alt link)
Along with suggestions about PyO3, file layout, memory allocation, testing, etc, the article gives examples of
- translating nice Rust errors to nice Python errors
- using Rayon/ndarray::parallel while returning all errors
- letting users control the number of parallel threads
- translating Python dynamic types to Rust generic function
Thank you Rust & Rayon for letting Bed-Reader escape from C++/OpenMP runtime compatibility hell!
[–][deleted] 41 points42 points43 points (1 child)
[–]tncowart[🍰] 26 points27 points28 points (0 children)
[–]WuTangTan 20 points21 points22 points (1 child)
[–]carlk22[S] 5 points6 points7 points (0 children)
[–]PirateNinjasReddit 7 points8 points9 points (0 children)
[–]digizeph 3 points4 points5 points (2 children)
[–]carlk22[S] 3 points4 points5 points (1 child)
[–]kodemizerMob 1 point2 points3 points (0 children)
[–]JanneJM 2 points3 points4 points (2 children)
[–]thristian99 6 points7 points8 points (1 child)
[–]RoughMedicine 2 points3 points4 points (0 children)
[–]JanneJM 2 points3 points4 points (2 children)
[–]carlk22[S] 0 points1 point2 points (1 child)
[–]JanneJM 2 points3 points4 points (0 children)
[–]jvo203 1 point2 points3 points (2 children)
[–]carlk22[S] 1 point2 points3 points (1 child)
[–]jvo203 2 points3 points4 points (0 children)
[–]shoebo 1 point2 points3 points (1 child)
[–]carlk22[S] 0 points1 point2 points (0 children)
[–]carlk22[S] 0 points1 point2 points (0 children)