3 ms·
It's actually pretty easy to call python from rust and rust from python. An incremental port of a python library into rust would definitely be possible. I'm no
by gpm 3y ago
It's actually pretty easy to call python from rust and rust from python. An incremental port of a python library into rust would definitely be possible.
I'm not sure it would be a good idea. Python patterns don't necessarily make good rust patterns. Even ignoring larger code structure (e.g. single ownership*) you'd practically have to do a second pass to stop using python compatible types (except in the exposed interface) if you wanted an idiomatic rust library at the end of it. But it's definitely possible.
* Which you don't "have to" do in rust, you can use `Rc<RefCell>` everywhere and imitate python instead. It's just throwing some of the advantages of rust and adding some noise to type signatures.