Writing and publishing a Python module in Rust
blog.yossarian.net
blog.yossarian.net
On the Rust side, I had to learn Box and RefCell to achieve my goals.
The trouble, though, is I looked through the code for a bit, and maybe I'm missing something, but I don't understand why this needs to be in Rust. I'd lean against combining languages like this unless there's a clear benefit from doing so that you can't get by just writing Python.
The first (and lazy) answer is that it was an educational exercise: I wanted to try my hand at writing in Python package in Rust, and this particular need afforded itself of me.
The second answer is that the package in question contains a (basic) parser, and it’s my opinion that Rust is particularly well suited to this domain: you should ideally only write a /proc/…/maps parser exactly once, with strong modeling of all valid and invalid states. Rust gives us that strong modeling for free (to say nothing of performance and memory safety), and it binds easily to other languages.