3 ms·
> If you fail to heed the fact that Rust is not really an OOP language, your entire program will start to look like the hairy parts of C libraries that interfac
by ssokolow 4y ago
> If you fail to heed the fact that Rust is not really an OOP language, your entire program will start to look like the hairy parts of C libraries that interface with the Python interpreter.
Any tips for those of us who see PyO3 as one of Rust's biggest killer apps?
(Honest question. I hate how unmaintainable Python is but I don't know of any better equivalent to PyQt/PySide's memory-safe QWidget bindings or the RAD-friendly ORM migrations in Django ORM or SQLAlchemy+Alembic.)
- whatshisface 4y agoI imagine it would go like writing a good C library for Python, where the PyResult<> wrappers disappear as you move deeper into your code and away from the interface. Hopefully working with Python objects on the outside won't require using references everywhere on the inside.
- ssokolow 4y agoAhh, so more or less what I'm doing. Design the Rust code as if it's going to be a generic C library with bindings for multiple languages and then write a PyO3 binding layer that just clones however much is necessary to convert until it's proven that more optimization is needed.