Blog
· 2 min read

What if Rails was Built on Rust?

Introducing Loco: a Rails-inspired Rust web framework. See how Rust can be as expressive as Ruby and how we can build a good deal of magic that Rails has with Rust.

Loco icon

What if Rails was built on Rust and not Ruby?

Then it would look like this:

async fn current(
auth: middleware::auth::Auth,
State(ctx): State<AppContext>,
) -> Result<Response> {
let user = users::Model::find_by_pid(&ctx.db, &auth.claims.pid).await?;
format::json(CurrentResponse::new(&user))
}
pub fn routes() -> Routes {
Routes::new().prefix("user").add("/current", get(current))
}

Introducing: Loco

Loco is a Rails inspired web framework for Rust. It inlcudes almost every Rails feature with best-effort Rust ergonomics:

It’s full stack for real.

Why not Rails?

If you’re happy with Ruby, use Rails. Don’t spend time looking elsewhere because of performance — Rails and Ruby are good enough.

But if you love Rust, you can now build companies like Rubyists have been building for ages — use Loco.

The One Person Framework

Inspired by DHH’s approach, Loco’s guiding principle is above all:

The one person framework

From this single guiding principles comes everything else.

For example, one person team, or one person company:

Loco is the one person framework for indy hackers, hobbyists, and startups.

With around 20mb of a deploy binary, and 50k requests/sec - all you need is a single small/medium server, Postgres or Sqlite and an internet connection. Startups should be cheap!

Get started with Loco today!