#[get("/")]
#[actix_web::main]
std::io::Result
HttpResponse::Ok().body("Hello world!")
I mean, blegh! Anyway, just making conversation please don't take offense, some people think Ruby looks like ass.Is Rust Ready for the Web Yet? (2020)
21–30 of 69 posts
Re: Is Rust Ready for the Web Yet? (2020)
#22I won't use it to build a website until we get something like Django, or at least something like Flask's ecosystem. I want automatic (or at least easy and without DRY problems) DB migrations. I want an auto-generated admin page; auth; email. I will continue using Rust for embedded, 3D graphics, and desktop PC programs, but won't touch it for websites until this is solved.
Auto generated admin stuff is pretty rare in anything outside Django I think, though I don't see why one couldn't make those for Rust. I suppose most devs would probably want their CRUD APIs to function on their own and use those for management if performance is critical enough that you'd prefer Rust over something like dotnet or Java.
Re: Is Rust Ready for the Web Yet? (2020)
#23Earlier quoted context omitted.
QT is still far ahead. This isn't a dig on Rust, but wherever Rust runs, so does C++. There are a lot of dimensions where Rust is better, but definitely not "runs everywhere" and "ecosystem".
My main gripe with QT is that apps created with it are, as a rule, ugly and non-native feeling. My suspicion is that this is because QT widgets sort of look like native widgets but aren’t quite there, causing it to fall into some kind of “uncanny valley” analogue.
You can use the win32 API on Windows and Gtk on GNOME, but for KDE and all else you'll need to use some kind of Qt wrapper that has the problems you encounter.
Re: Is Rust Ready for the Web Yet? (2020)
#24Re: Is Rust Ready for the Web Yet? (2020)
#25With all due respect does anyone else find Rust's syntax just horrible? #[get("/")] #[actix_web::main] std::io::Result HttpResponse::Ok().body("Hello world!") I mean, blegh! Anyway, just making conversation please don't take offense, some people think Ruby looks like ass.
There's (at least) three things going on in the snippet you posted. One is that actix, like most (all?) Rust frameworks, is macro based; that code would look pretty similar if it were written in Flask, but with different syntax.
Another is that the strict type system can lead to some heavy verbosity, eg having to populate the generic in `std::io::Result` with unit (`()`) just to say you're not returning anything.
Regarding `HttpResponse::Ok().body("Hello world!")`, the builder pattern is also pretty verbose and some people don't like it, but it's friendly to the type system and you can use it to provide really cool guarantees (like not being able to call `build()` until you've fully populated the builder).
Generally I'm of the mind that computers should conform to the needs of people and not the other way around, but programming language are a place where I'm willing to make many concessions, since as a rule humans are smarter than compilers.
Re: Is Rust Ready for the Web Yet? (2020)
#26I won't use it to build a website until we get something like Django, or at least something like Flask's ecosystem. I want automatic (or at least easy and without DRY problems) DB migrations. I want an auto-generated admin page; auth; email. I will continue using Rust for embedded, 3D graphics, and desktop PC programs, but won't touch it for websites until this is solved.
In terms of database and framework design there are several Rust libraries that come close. Diesel for database and migrations and something like Rocket for the backend itself should be enough for a quick JSON API or Thymeleaf based page renderer. Auto generated admin stuff is pretty rare in anything outside Django I think, though I don't see why one couldn't make those for Rust. I suppose most devs would probably wa…
Just wanted to say that anywhere from Ruby on Rails, to Laravel, to Yii, to... Pretty much every major web framework in the most common language used for web dev (php, python, ruby) has a builtin admin (among tons of other stuff).
Edit:
> Diesel
Diesel doesn't come close to where the ORMs of Django or RoR stand. Not by chance. Having to write by hand SQL (according to Diesel's docs) is something that modern web frameworks solved years ago. And I'm not even talking about automatic mapping of models to tables, automatic migrations, etc... Diesel is simply not anywhere near what a web dev would expect. Not saying that Diesel is bad, just that it's not in the same category where current ORMs stand.
Re: Is Rust Ready for the Web Yet? (2020)
#27Re: Is Rust Ready for the Web Yet? (2020)
#28It looks like this article requires sign up to read.
https://scribe.rip/is-rust-ready-for-the-web-yet-9ec38c01dca...
Re: Is Rust Ready for the Web Yet? (2020)
#29Re: Is Rust Ready for the Web Yet? (2020)
#30I won't use it to build a website until we get something like Django, or at least something like Flask's ecosystem. I want automatic (or at least easy and without DRY problems) DB migrations. I want an auto-generated admin page; auth; email. I will continue using Rust for embedded, 3D graphics, and desktop PC programs, but won't touch it for websites until this is solved.
In terms of database and framework design there are several Rust libraries that come close. Diesel for database and migrations and something like Rocket for the backend itself should be enough for a quick JSON API or Thymeleaf based page renderer. Auto generated admin stuff is pretty rare in anything outside Django I think, though I don't see why one couldn't make those for Rust. I suppose most devs would probably wa…
And in my experience going from Django to anything in Rust will be at least 10 times the boilerplate and some things will be very very annoying to handle, especially things like sharing parts of model, automating things like creation / update metadata for all models, and even sharing authentication mechanism for most routes can be annoying depending on the way you have to do authentication (in my case Firebase auth so authenticating sometimes does require making async calls... And that's a trouble).