New framework for Rust gains popularity: overview of features and prospects
The Rust language ecosystem continues to actively develop. In 2024, a new player appeared on the web framework market — Fermyon Spin (or, depending on the context, Loco.rs — this is the project being discussed in recent news). However, if we talk about the biggest release of recent months, it is the Loco.rs framework, which is being called "Ruby on Rails for Rust." It is rapidly gaining popularity among developers tired of boilerplate code and wanting maximum performance without sacrificing convenience.
What is Loco.rs and why is everyone talking about it?
Loco.rs is a full-featured web framework for Rust, inspired by the ideas of Rails and Django. Its main goal is to make development in Rust as fast and enjoyable as in dynamic languages, while retaining all the advantages of systems programming: memory safety, zero-cost abstractions, and high execution speed.
Main reasons for Loco.rs's growing popularity:
- Quick project start. Unlike bare-metal solutions (e.g., plain Actix or Axum), Loco provides code generators, database migrations, and built-in ORM support (SeaORM).
- Built-in CLI. The
locoutility allows you to create an application scaffold with support for SQLite, PostgreSQL, or MySQL in seconds. - Background tasks and caching support. Integration with Redis and queues is available out of the box.
- Active community. In the first months after the public release, the project gathered several thousand stars on GitHub and received dozens of contributors.
How Loco.rs is changing the landscape of web development in Rust
For a long time, Rust was primarily associated with systems programming, CLI utilities, and blockchains. Web development in Rust existed but required a high level of developer skill: routing, middleware, serialization, and migrations had to be configured manually. Loco.rs takes care of 80% of this routine.
Key use cases for the new framework:
- API services and microservices. Thanks to built-in support for JSON API, JWT authentication, and Swagger documentation.
- Prototyping. If you need to quickly test a hypothesis but want to do it in Rust.
- High-load systems. Combined with the Tokio async runtime, Loco shows excellent results in benchmarks.
Comparison with alternatives
Popular frameworks already exist on the market: Actix Web, Rocket, Axum. What makes Loco.rs different?
- Actix Web — fast, but low-level. Requires more code for typical tasks.
- Rocket — convenient, but slow to adapt to new Rust versions.
- Axum — an excellent choice for those who want to control every aspect, but without a built-in CLI and ORM.
- Loco.rs — a compromise: retains Rust's performance but provides tools familiar to Rails/Django developers.
Prospects and predictions
According to surveys on Reddit and H