4 ms·
>Something I have never understood is why people want to write web-apps in Rust. The vast, vast majority of web apps are the same CRUD endpoints and background
by Klonoar 4y ago
>Something I have never understood is why people want to write web-apps in Rust.
The vast, vast majority of web apps are the same CRUD endpoints and background job queue processing. I would label Rust as mature enough in this regard; I've written quite a few of these and am not left wanting in any regard (short of a clone of Django's automagic admin, but few things get close to this anyway...).
When you accept the fact that you're taking in some data, shoving it into the DB, and returning a response, the rest of the Rust ecosystem becomes pretty damn nice - deployment is an absolute breeze compared to some of the other ecosystems (Ruby/Python). I don't need to mess with Docker, I don't need to deal with broken package managers, I can just replace a binary and call restart.
It's amazing.
- the__alchemist 4y agoCommon things webapps use that Rust frameworks don't provide: - High-level DB migrations - Auth - Email - Admin - Templating You get these immediately with eg Django, but not in Rust. I'm not trying to be contrarian; I'm confused, and have never heard an answer about this point.
- Klonoar 4y agoNo worries, I don't think you're being contrarian - I think projects that properly do this stuff have trouble rising above the micro-framework-style projects. https://github.com/secretkeysio/jelly-actix-web-starter https://github.com/secretkeysio/jelly-actix-web-starter I put all of this together some time ago, explicitly modeled after Django. This repo isn't up to date with actix-web 4 as I've been too busy with other (paying) work, but it absolutely exists. I've used this for services in production with no issues. I really do need to get time to finish and push the updates though. Mine isn't even the first, I'm pretty sure there are others working in this space. Just needs the right people pushing it.
- the__alchemist 4y agoOh wow! Very appropriate. Looking forward to seeing this fleshed out when you get more time. Will give it a shot on my next project.
- zamalek 4y agoPeople can be wary of these bolts-included/on-rails solutions because there is typically hell to be paid as soon as you venture slightly off of the rails. If not, they also tend to have an overabundance of features; leading to slowness or a fertile ground for vulnerabilities. > High-level DB migrations Having used Datadude[1] I can say for certain that there are few approaches worse than migrations. The problem is that, once you are stuck with a turn-key framework, you are completely stuck with their approach (which is usually horribly archaic). Unbundling all of these things might require more work up-front, but can result in significantly improved productivity in the long run. [1]: https://www.sqlshack.com/working-with-database-projects/ https://www.sqlshack.com/working-with-database-projects/
- Winsaucerer 4y ago> People can be wary of these bolts-included/on-rails solutions because there is typically hell to be paid as soon as you venture slightly off of the rails This is so very often the case, and you often can't tell in advance before you use the framework or library or whatever. You just have to use it, and get to a certain point of maturity in your project before you discover these limits.
- scns 4y agoI was reminded of Rust on Nails [0], which i found here [1]. [0] https://cloak.software/blog/rust-on-nails/ https://cloak.software/blog/rust-on-nails/ [1] https://github.com/tokio-rs/axum/blob/main/ECOSYSTEM.md#project-showcase https://github.com/tokio-rs/axum/blob/main/ECOSYSTEM.md#proj...