March 26, 2023
top rust frameworks
I researched various sources on Reddit and found a range of opinions and recommendations for top Rust frameworks [1][2][3][4][5][6][7][8][9]. There was a fair amount of consensus on some popular frameworks, but also a variety of lesser-known ones that may be worth considering. Keep in mind that user preferences and experiences can vary significantly, so it's essential to evaluate each framework based on your specific needs.
Have an opinion? Send us proposed edits/additions and we may incorporate them into this article with credit.
Words
0
Time
1m 59s
Contributors
302
Words read
19.5k
Draco
Seed
Willow
Ruukh
Smithy
Dioxus, Slint, and Egui
Actix, Xitca-web, Salvo, Axum, and Warp
Tide, Poem, and Tower
Templating Engines
Jump to top
Research
Source: "Picking a Rust web framework for microservices" (from reddit, r/rust)
-
Rocket
- Batteries-included framework offering similar features as Django
- Easily the most ergonomic
- Likely to land support for async and stable Rust fairly soon
-
Warp
- Pretty absurdly fast
- Set up was also really easy
- The todo example helped figuring out how to structure code in a nice way
-
Actix
- Used to have more unsafe code, but have improved dramatically
- We use actix and it works well
- Amount of info on how to use it is more compared to other Rust frameworks
-
Tide
- Small and focused
- More similar to Flask rather than Django
-
Tower
- Developed by Buoyant, the people that made linkerd
- Might be a good fit for microservices
Source: "warp v0.2: the composable web server framework" (from reddit, r/rust)
-
Warp v0.2
- Used in production for almost a year
- Small, unopinionated, no-ORM, no-batteries-included
- Solid expressive abstractions that don’t get in the way
- Has examples
- Filter design is very simple yet expressive
- No relation to Haskell’s Warp
- Bump to Tokio 0.2/Warp master is smooth
- Warp filter API is liked
- Requires Rust 1.40+
-
Other Rust Frameworks
- Not mentioned in the source
Source: "Choosing a Rust web framework, 2020 edition" (from reddit, r/rust)
-
Actix-Web
- It is closer in spirit to Flask from Python or Express from Javascript.
- It has terrible compile times due to existentials that hit the type checker hard, as well as a long link time.
- It is the only one on async-std.
- It is way more flexible than Rocket in regards to returning your own payload for errors in guards.
-
Rocket
- It is closer in spirit to Django from Python or Symphony from PHP.
- It has pretty much all the features of Flask, along with the usability and a fair amount of the documentation.
- It is sync, which is an advantage for people who don’t need super high requests-per-second and who prefer the type simplicity that comes from avoiding async.
- It uses nightly features.
-
Tide
- It is the only one on async-std.
- It is still behind Actix-Web at this point.
-
Warp
- It is closer in spirit to Flask from Python or Express from Javascript.
- It has terrible compile times due to existentials that hit the type checker hard, as well as a long link time.
- People should not expect the same level of documentation, tooling, or support as frameworks like Flask or Express.
-
Torchbear
- It is a Rust-based implementation of Actix-Net, with lots of examples using Actix for concurrent request processing.
- It is an even more powerful networking framework that also has high-level scripting and many more out of the box integrations.
Source: "What is the most popular and best-supported Rus..." (from reddit, r/learnrust)
-
Axum
- Lightweight framework similar to Flask
- Works with Tower to help with middlewares
- Suggested to use with Sea-ORM for interacting with PostgreSQL
-
Askama
- Templating engine similar to Jinja2
-
Yew
- Frontend framework
-
Sycamore
- Newer frontend framework
-
Tera
- Templating engine
-
Leptos
- Framework with lots of good ideas
-
MiniJinja
- Templating engine
💭 Looking into
What are the most popular web frameworks written in Rust?
💭 Looking into
What are the advantages and disadvantages of using Rust for web frameworks?
💭 Looking into
How does Poem compare to Actix and Axum in terms of performance?
💭 Looking into
What kind of integration does Axum have with OpenAPI?
💭 Looking into
What are the advantages of Warp over other frameworks in terms of the request model/lifecycle?
💭 Looking into
What kind of support does Actix provide for Tokio?
💭 Looking into
What are the advantages of Rocket over other frameworks in terms of documentation and ease of use?
Source: "What made you choose the rust web framework you..." (from reddit, r/rust)
-
Rocket
- very good documentation and ease of use
- can return an iterator as a Responder
-
Actix-Web
-
supports all of Tokio except for
block_in_place(task)
-
supports all of Tokio except for
-
Warp
- Simple but powerful Filter model
- Open-ended - Great to build a custom request model/lifecycle.
- Great use of Rust typing model.
- Default to Tokio
-
Axum
- One of the newest players in the space
Source: "Which Rust web framework to choose in 2022 (wit..." (from reddit, r/rust)
-
Rocket
- It is not included despite being more popular on GitHub relative to the competition
- It has been unmaintained since August last year, although the maintainer has committed a few changes the last days
- It feels much more batteries included than other frameworks
-
Actix
- It is flexible, based on traits
- There are a number of papercuts when using it with Tokio-based libraries
-
Axum
- It is part of the Tokio project and thus benefits from its huge ecosystem and community
- It has a middleware API superior to Actix
- It supports OpenAPI
-
Tide
- It is fairly similar to Axum but uses std-async instead of Tokio
- It has a middleware API superior to Axum
-
Poem
- It is relatively the same in terms of code as Axum
- It has good OpenAPI integration
- It is faster than Actix and Axum
-
Warp
- It has a declarative nature
- It is type-checked together with route implementations
Source: "5 of the Top 10 Fastest Web Server Frameworks a..." (from reddit, r/rust)
-
Actix
- 98.6% relative score
- Is a Rust framework
- 90.7% relative score
- Code is reasonable and idiomatic
-
Xitca-web
- 98.0% relative score
- Is a Rust framework
-
Salvo
- 83.5% relative score
- Is a Rust framework
-
Axum
- 82.6% relative score
- Is a Rust framework
- Lagging behind other Rust frameworks in JSON serialization by ~20-50%
- Performance is hindered by routing and boxing
-
Warp
- One of the worst performers
- Performance is not purely due to being written in Rust
-
Just-js
- JavaScript framework
- 700 SLoC of C++ code in the codebase
- Performance is boosted by tuning JS to play nicely with V8
-
Django/Ruby on Rails
- Slow due to the languages they’re written in (Python/Ruby)
- Feature sets are massive, causing them to do poorly
Source: "Personal review for rust GUI frameworks" (from reddit, r/rust)
-
Dioxus
- Small package size, usually 2MB
- Mature frontend technology and ecosystem
- Fermi provides a good global state management solution, no need to deal with complex life time issue
- Depend on webview2 component, some old system might not have it by default
- Cannot cross build from macos to windows, has to be built with msvc toolchain
- Kind of inactive development, author seems slowed down
-
Slint
- Very small package size, 1MB with zero dependency
- Cross platform and cross build support
- Good IME integration and unicode character support
-
Declarative UI creation with
slint
language, simple and effective - Good default look and feel (fluent dark theme)
- Active development
- Layout mechanism is immature, no Grid Layout support for loop or flex layout
- Some controls are not product ready, like TextEdit has poor performance with large amount of text
-
Egui
- Medium package size, 3MB with zero dependency
- Cross platform and cross build support
- Good IME integration
- Good default look and feel
- Has to manually load font to support unicode
- Code could become verbose for complex UI and life time management will be hard
- Inactive development
Source: "The state of Rust frontend frameworks" (from reddit, r/rust)
-
DenisKolodin/yew
- Developed by Denis Kolodin
- Inspired by Elm
-
utkarshkukreti/draco
- Developed by Utkarsh Kukreti
- Inspired by Elm
- Recommended by user /u/unfoldl
-
David-OConnor/seed
- Developed by David O’Connor
- Inspired by Elm
- Recommended by user /u/firefrommoonlight
-
sindreij/willow
- Developed by Sindreij
- Inspired by Elm
- Recommended by user /u/sindreij
-
csharad/ruukh
- Developed by csharad
- Inspired by React
- Recommended by user /u/sharcnd
-
rbalicki2/smithy
- Developed by rbalicki2
- Inspired by React
- Recommended by user /u/balicki2
💭 Looking into
What are the best Rust frameworks?