6 ms·
If you accept the divide between back-end and front-end (and the need to have separate developers for each), this is fine. But I, for one, prefer full-stack ser
by mwcampbell 4y ago
If you accept the divide between back-end and front-end (and the need to have separate developers for each), this is fine. But I, for one, prefer full-stack server-side frameworks such as Rails, Django, and Phoenix, where the server side does HTML generation, HTML form processing (with CSRF protection), authentication with session cookies, etc. Bonus points if, like Phoenix or ASP.NET Core, the framework has integrated support for real-time applications using WebSockets. AFAIK, Rust doesn't have anything quite this comprehensive, though such a framework could certainly be developed.
- mcronce 4y agoNope, as far as I know there's no serverside HTML generation crate. Granted, I haven't looked, but I feel like it would have come up on /r/Rust sometime. Everything else you mentioned is out there, although I didn't love the websocket experience the one time I needed them for something.
- steveklabnik 4y agoMost rust web frameworks are server side, and generate HTML, so I’m not sure what you were looking at, but it absolutely exists. Most rust web stuff is server side generated.
- mcronce 4y agoSure, obviously you can generate strings containing HTML and send those. I'm imagining something like the serverside rendering you get with e.g. React. That said, I don't know what specifically the previous poster was looking for.
- steveklabnik 4y agoI'm a bit confused, what's the difference? SSR React also ends up "generating strings containing HTML and sending those."
- Winsaucerer 4y agoI don't really know what you mean by serverside HTML generation crate. HTML is just HTML. What I usually need is some templating system, and that can be used to produce HTML, SQL, or whatever else I want. Use askama or tera, for example. Here's an example of using askama with axum: https://github.com/djc/askama/tree/main/askama_axum https://github.com/djc/askama/tree/main/askama_axum If you mean something more significant, like what an ORM/query builder is to SQL, then I haven't really had a need for such a thing myself. It's far more likely to get in my way when I stray past common scenarios.