4 ms·
It's really cool how easy it is to interact with the Python environment, and that you can do it without actually writing any Python or needing a Rust compiler o
by ufmace 5y ago
It's really cool how easy it is to interact with the Python environment, and that you can do it without actually writing any Python or needing a Rust compiler on the system you're using the Python package with.
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.
- deleted 5y ago[deleted]
- woodruffw 5y agoI’m the author of the package in question, so I can try to answer that. 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.