3 ms·
This content, while still accurate (Rust is Web-ready, and all the frameworks listed are excellent!), is missing out a few credible and recent options. In part
by DelaneyM 4y ago
This content, while still accurate (Rust is Web-ready, and all the frameworks listed are excellent!), is missing out a few credible and recent options.
In particular I want to shout out for Axum (https://github.com/tokio-rs/axum https://github.com/tokio-rs/axum), from the folks who brought us Tokio. I've been building with it for the past few weeks and have enjoyed every minute.
I started with Warp, but ended up struggling a bit with middleware. I tried Axum as a web framework wrapper for tower (https://crates.io/crates/tower https://crates.io/crates/tower), and never ended up bothering to reintegrate back into Warp.
- lucasyvas 4y agoWarp's filters (middleware) were the same reason I left for Axum. Axum is very similar to Warp ergonomically, without the heavy macros and with sane middleware. I think Warp paved the way for Axum in many ways though, so it deserves a lot of credit.
- shepmaster 4y agoDitto with my journey from Warp to Axum. The Rust Playground now uses[1] Axum as its backend and I’ve been pleased with working with the maintainers. [1]: https://github.com/integer32llc/rust-playground/pull/777 https://github.com/integer32llc/rust-playground/pull/777
- tempest_ 4y agoI have been toying around with Axum a bit and it is nice as a web framework. I really appreciate the many examples in the repo. Having come from python (day job) I did hit a screeching halt when it came time to meaningfully interact with a database. It is unfair to compare Rusts current offerings to something as mature as SQLAlchecmy but boy does it slow things down dev wise to be mapping my own types and queries using tokio-postgres. I've looked at Diesel, sqlx and SeaORM but have not yet committed to learning one yet. I've also used Warp for some small web server stuff in the past as well. It is an interesting approach but definitely a little different.
- steve_adams_86 4y agoAlthough you do get the initial screeching halt, I’ve found having those types mapped out and with sqlx actually makes for a very nice and fast dev experience eventually. Having typed queries right in the IDE is pretty amazing. Similar to typescript, where years ago I thought “but I just want to write code!”, now I can’t imagine going back. At least not for meaningful projects where I need to care about consistency and stability for more than a few months/for something critical. The initial slowdown affords you a lot in the longer term.
- bredren 4y agoI am picking up SQLAlchemy as a long time Django ORM user. I’m somewhat wide-eyed at how much simpler and more readable query building is in Django. I have been spoiled. SQLAlchemy is closer to SQL than I generally want to be for pedestrian web programming. It also lacks conveniences I’ve taken for granted writing Django backend. Even for writing data migrations in scripting, having ORM queries be incredibly simple to read and modify is extremely valuable, it makes code reviews accessible to more people. I’m not a rust developer, though I admire what it can do. That said, having looked at the starter queries on each, it would take a lot to make me contemplate use of any of the rust-based ORMs you’ve listed. As a sibling comment points out, typing and async are valuable and Django has no typing and is still working on delivering async support in its ORM. That said, for web products reducing time to flipping feature flags seems to be the main goal. In that way Python / Django and I suppose even SQLAlchemy will probably retain users against Rust.
- Too 4y agoMypy together with this plug-in gives you typing for django. https://github.com/TypedDjango/django-stubs https://github.com/TypedDjango/django-stubs
- fatihpense 4y agoYou might be interested in our community interview with Tokio Axum maintainer David Pedersen. It is recent and covers a lot of intermediate Axum stuff. https://www.youtube.com/watch?v=nZLimYT4EHs https://www.youtube.com/watch?v=nZLimYT4EHs