Rust on Nails
rust-on-nails.com
rust-on-nails.com
(If you're just making a simple rest api backend, I still dig the simplicity of poem-openapi + sqlx)
I can't understand if rust on rails is a joke, badly written by gpt, or written by someone who doesn't understand both Rust and web development in general. It's full of typos and baffling design decisions. (shelling out to an external comand to generate rust code?! MACROS EXIST!)
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.
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.
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.
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).
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.