I was wondering if there is anyone here that us using Rust as their primary language for web development?
How is it?
I am having a look at Actix and its looking great.[0]
[0]: https://actix.rs
What I like about Rust, and where it makes the biggest difference to my previous jobs, is the type system and the compiler.
I am using it currently to build distributed systems, using gRPC, adding GraphQL services etc. So there is enough there to take you started without having to rewrite everything yourself.
The community is great to get answers, even many crates have active GitHub discussions or Discord servers.
Sure, there are differences in axum, actix and others. But to be honest, will this impact your productivity all that much?
For some cases, the tooling could be more mature, but the language itself makes you more productive and you are having more fun with it. I also talk about it on the Software Engineering Radio podcast episode. [2]
So I can’t speak for frontend apps, or if you come from Go etc. But I have fun using it for my side projects, and in my day to day life for 3-4 years now, Rust had a substantial impact on the productivity of teams I am working at.
Rough edges are there, yes. Async is maybe not as easy as in Go, and you have to think about memory management more. But these tradeoffs are worth it for me.
[1]: https://www.manning.com/books/rust-web-development [2]: https://www.se-radio.net/2023/05/se-radio-562-bastian-gruber...
1. The only production-ready Rust web servers require writing async request handlers. Async Rust is not fun.
2. The only good Postgres client library is async: https://crates.io/crates/sqlx
I'm trying to remedy the first problem with https://crates.io/crates/servlin .
Solving the second problem will be another project. I hope someone else does it. There is https://crates.io/crates/diesel but it has the same problem as async Rust: incomprehensible build errors.
I feel -- at least at my level of Rust competence -- working with the borrow checker becomes a combinatorial puzzle where you're mostly trying to just make the errors go away. Even for my simple service the method signatures get quite rediculous, and the amount of indirection involved required to satisfy the borrow checker is not something I feel would scale well.
I'd say the type system is awesome to help model your problems and make sure invalid states can't be represente
The biggest drawback is big(ish) compile times/feedback loops; I can get it down to around 2s on a project that builds SCSS and bundles assets within Rust, but it (and any other compiled language, really) can't beat the fast iterations interpreted languages give you.
I love Rust as a language, and its built-in tooling. Web dev requires higher-order tooling that isn't currently in a state I'm happy with. So, I can see myself using Rust in the future for web programming once this is fixed.
It gives you an idea of what a full stack in Rust can look like.
If your company has rust knowledge and/or really cares about perf, and there are no major third-party libraries you’d need that are lacking, it’s a great choice I think.
I have not used Rust for the FE side of web dev (eg yew), so I can’t speak to that.