Can anyone who has done web dev on Rust share their experience? I’ve read some Rustaceans say web dev is left best to other stacks; especially for someone just starting out in Rust.
Well, if you're coming from python/Javascript I'd reach for Go as a first reasonable step in your transformation into a wizard.
I think the complexities are inescapable and it is just a question of how we smear them around. Javascript is much easier to get started and you drown in frameworks, trivialities, nyan cats, fads.
If you are very pragmatic you'll learn to quickly make imperfect decisions and just get a bunch of stuff done, the resulting spaghetti is for some other bastard to deal with at a later date. Unfortunately that just might be future you.
With Go you'll spend a few weeks studying first and then the blessed happy well trodden paths will usually become clear and take you very far.
With Rust you'll spend months learning deep lore and getting used to the syntax only to end up sitting in somber Gandalf like contemplation paralyzed at the state of async and the lack of hand holding and courses and cults. Possibly forget what you originally set out to do, start writing compilers. It is a minefield of nerd snipes and requires a certain amount of maturity and independent thinking. Rustaceans don't wear fedoras.
The Rust programs I work on are aren't primarily web programs, but most of them have HTTP interfaces for command, control and/or monitoring. Some of these are API-only, but some actually have serve up tiny HTML/Javascript apps too.
It's fine enough that now that I'm familiar with it, it's what I'd reach for if I had to do a small web only app.
It is true for most web apps that are just moving data between a database and HTML.
Rust has features for maximizing performance and optimizing memory usage, but for a lot web apps JS or Golang can be efficient enough.
Rust has features for safely working with large projects and complex multi-threaded code, but for web apps simple request-response processing may be good enough.
On the front-end only JavaScript can touch DOM or communicate with the rest of the world, so all your Rust will only be delegating work to JS. That's a pure overhead, unless you have a lot of other computation to do.
Rust is still awesome for lower-level networking infrastructure (servers, proxies, etc.) and tooling (e.g. log parsing and stats, compression, image processing).
Rust can be beneficial for web services that are compute heavy or process large amounts of data (e.g. working with map data) and tasks that need speed and low latency (e.g. video conferencing back-ends).
If you know web dev it’s not to bad. Pick your own http framework, Axum/Actix, pick your favourite template language/library. Not as simple as Rails/Django but shouldn’t be anything unexpected. Rust on Nails tries to give you an opinionated setup instead of composing your own to make the choices for you with reasonable options.
REST style stuff is generally trivial.
I personally do my web dev in Rust. Admittedly it does take a little more effort but I don’t think massively. The advantages are good type system, compile time errors, with a few settings, small binary sizes and great performance. I don’t really care about speed as long as it’s reasonable but Rust performance allows me to run apps on the cheapest lowest spec servers and still beat NodeJS/Python on far more expensive servers.
We do a react app on the frontend and actix+diesel REST API, with Keycloak JWTs for user management. The actix+diesel REST API is much more solid and less troubling than another python flask API we have.
I still think frontend/backend split is useful for the types of applications my team works on. Stateful, interactive UI clients written in React, without round trips for full page loads is going to be our choice until a Rust WASM frontend client system reaches maturity.
It’s fine. It’s the React experience and not the Angular one, though; You’ll have to do some assembly yourself. There’s some immaturity around the edges, though, for example regarding GraphQL and OpenAPI.