4 ms·
>it would be nice if CPU intensive algorithms could be written in it It would be nicer if instead of trying to turn python into something it is not (a language
by crdoconnor 9y ago
>it would be nice if CPU intensive algorithms could be written in it
It would be nicer if instead of trying to turn python into something it is not (a language for writing CPU intensive tasks), it was made better at what it is (glue code).
It would be especially nice if there were tighter, more seamless integration between python and rust so that hot paths in python can easily be migrated to rust.
- mjburgess 9y agoNo to threading, but yes to tighter integration with rust. Ah yes, let's not focus on something python is not. Let's appeal to the majority use case. What minor planet are people here from?
- Walkman 9y agoPython is far more than glue code.
- sevensor 9y agoI'm not a Rust guy, so take this with a grain of salt, but I was under the impression that Rust did a great job with C interoperability, which is all you need for writing Python extensions. Some hasty googling brings up https://github.com/PyO3/setuptools-rust https://github.com/PyO3/setuptools-rust, which appears to be exactly the thing you're asking for. In other words, it's not heavily advertised, but it appears to be entirely feasible to build Python extensions in Rust, and not spectacularly complicated either.
- crdoconnor 9y ago>Some hasty googling brings up https://github.com/PyO3/setuptools-rust https://github.com/PyO3/setuptools-rust, which appears to be exactly the thing you're asking for. Yeah, I've tried it and it didn't work. It's certainly feasible it's just not very well developed.
- steveklabnik 9y agoThe language does do great at the core of it, but there's a lot of stuff that makes it easier that's not the language's job. compare https://doc.rust-lang.org/1.2.0/book/rust-inside-other-languages.html#ruby https://doc.rust-lang.org/1.2.0/book/rust-inside-other-langu... to http://usehelix.com/ http://usehelix.com/ for example; the former is only using what the language knows, the latter is a nice library built on top. There's been some effort for nicer Python integration, but I haven't seen anything super super slick yet.