4 ms·
If you hate Python so much you need to replace the linters, package managers, and now Web frameworks with Rust, why not just go all the way and write everything
by Kwpolska 2y ago
If you hate Python so much you need to replace the linters, package managers, and now Web frameworks with Rust, why not just go all the way and write everything in Rust?
- robmsmt 2y agoPython's success is partly because it is easy to do things. It has a huge market share. Combining the speed advantage of one programming language, with another seems like a great idea.
- Kwpolska 2y agoIs it really going to be faster? In the benchmark they cited in the README [0], they are in 10th place among Python frameworks. This is not a real-life benchmark, as it merely expects a hardcoded response. In fact, Robyn’s 10th place is thanks to a feature designed for benchmarks like this, i.e. marking responses as constant [1]. Three more frameworks beat Robyn if you disable this benchmark optimization. [0] https://www.techempower.com/benchmarks/#hw=ph&test=plaintext§ion=data-r22&l=zijzen-cn3 https://www.techempower.com/benchmarks/#hw=ph&test=plaintext... [1] https://robyn.tech/documentation/en/api_reference/const_requests https://robyn.tech/documentation/en/api_reference/const_requ...
- robmsmt 2y agoCan't speak for Robyn since that is competing in an already aggressively competitive landscape (webserving). Whereas introduction of RUFF/UV by astral has been exceptional.
- skeledrew 2y agoThe problem with all this combining is that it's making apps less portable. Like I want to make apps that work on desktop+mobile with flet[0], but now I have to specifically seek out more "traditional" alternate packages and hope they stayed in reasonable feature parity with these Rustified Frankensteins. Not a fan at all. [0] https://flet.dev https://flet.dev
- djl0 2y agoCorrect me if I'm wrong, but the way you use "traditional", basically means "written in C", right? I certainly can sympathize with your point about the frustration of compatibility issues in your narrow usecase (though I don't agree that it should affect what options we have), but connecting to the original commenter's point, it's really common for libraries in python to be wrappers for things written in other languages.
- skeledrew 2y agoThe use case isn't that narrow though. Just the flet project has 12.5k GH stars (which I would say represents significant adoption), and I'll wager there are other projects out there running in random environments that have Python support but bringing in Rust will be a serious pain. It's degrading the ecosystem IMO. The only other language I'm aware of that has significant library wrapping is Fortran, and those libraries have on par or better alternatives in C as well as are now essentially legacy.
- afavour 2y agoHasn’t Python had native modules for eons now? How is this any different?
- Kwpolska 2y agoThere’s native modules to speed up hot paths, and there’s writing 29% [0] of your framework in Rust, entirely sidestepping interoperability standards, like ASGI. [0] https://github.com/sparckles/Robyn https://github.com/sparckles/Robyn says 50% Python, 25.3% JS, 20.7% Rust — but all the JS code seems to be for their docs site, so it is reasonable to say 20.7 / 70.7 = 29.2% is in Rust.
- surajrmal 2y agoFascinating that the website requires more js than they use rust on the actual framework.