3 ms·
Serious question: why would I want to use this? Is the answer as simple as “because I want to develop in Python”?. Because if you’re going to do it in Rust, wh
by gdcbe 4y ago
Serious question: why would I want to use this? Is the answer as simple as “because I want to develop in Python”?.
Because if you’re going to do it in Rust, why not just go all the way with something like Axum?
That being said, first time I hear about WSGI/ASGI, so I did some reading. From an educational perspective I’m intrigued and even will check the codebases at some point to see how it works.
But from a production POV I do not get why I would want to use it. What’s so great about it - besides letting you develop a reasonably fast server in Python, surely it is more then that?
- connicpu 4y agoGranian is more of a web server for python that just happens to be implemented in Rust. Python developers using Granian wouldn't need to know or write any Rust, just like they don't need to know or write any C in order to use python modules that just happen to have C components to make them faster. The module containing substantial Rust code is merely an implementation detail.
- woile 4y agoTheoretically, an asgi server sits in front of your fastapi or starlette. This asgi servers are usually written in python (maybe calling some c code underneath). You can "probably" gain some performance by writing the asgi server in rust. I don't know how much better is this.
- gi0baro-dev 4y agoYou can check benchmarks https://github.com/emmett-framework/granian/tree/v0.2.2/benchmarks#vs-3rd-parties https://github.com/emmett-framework/granian/tree/v0.2.2/benc... ;)
- simonw 4y ago"What’s so great about it - besides letting you develop a reasonably fast server in Python, surely it is more then that?" Sounds to me like you've figured out the reason for this project just fine!