Remix.run Logo
newaccountman2 4 days ago

I don't feel like this is solving the painpoints I feel in the Rust web framework ecosystem. And how is it full-stack if they don't have anything for the DB layer in here?

carllerche 4 days ago | parent | next [-]

This will (very soon) integrate tighter with the Toasty ORM http://github.com/tokio-rs/toasty/. E.g. tight form -> record flow. We are shipping now though to get usage.

What pain points do you have in the Rust web framework ecosystem? Happy to hear.

newaccountman2 4 days ago | parent [-]

Oh cool, I will poke around Toasty. I am in the process of having LLM switch a project from some raw sqlx jank to Diesel, and mildly annoyed about some the boilerplate Diesel involves. Will have to see if Toasty solves it and whether it lets one query for arbitrary structs and add fields to structs from query results (e.g., in the README example for Toasty, explicitly joining on TODOs and mapping them to a simple field on the User objects as opposed to using ORM `has_many`)

> What pain points do you have in the Rust web framework ecosystem? Happy to hear.

I think I have more "gripes" than strong pain-points admittedly. Off the top of my head, complaints about boilerplate to simply access path params and JSON bodies.

Currently using Rocket, but it looks dead and unsupported. It's not perfect, but I like aspects of it, such as the global error handling and relative ease of accessing params.

Probably going to seem nitpicky, but compare these 2:

Rocket ``` #[get("/chat/threads/<thread_id>")] async fn get_thread(thread_id: Uuid) -> Result<Json<ThreadResponse>, AppError> ```

Actix ``` #[get("/{name}")] async fn hello(name: web::Path<String>) -> impl Responder ```

Why can't name just be String? Why can't `hello` endpoint just indicate clearly what it returns?

carllerche 4 days ago | parent [-]

> Will have to see if Toasty solves it and whether it lets one query for arbitrary structs and add fields to structs from query results (e.g., in the README example for Toasty, explicitly joining on TODOs and mapping them to a simple field on the User objects as opposed to using ORM `has_many`)

I'm not 100% following. Feel free to ping me in discord (https://discord.gg/tokio) or open an issue on Toasty and we can dig into it. Toasty is also pretty new, but maturing fast.

The other points are valid. There are challenges with extracting params and a type system. This is how topcoat does it: https://docs.rs/topcoat/latest/topcoat/router/attr.path_para...

newaccountman2 3 days ago | parent [-]

My "arbitrary structs" thing is exactly what Aeltoth was discussing in the Discord a couple days ago.

For the other part, I am basically saying I don't like, if one has a FK from Posts to Users, the ORM semantics of having user.posts automatically eagerly populated OR Deferred. I personally prefer to write SQL DSL in whatever language I am using whenever there is a join and explicitly add gather and add the posts. But I should probably get over that. Most of the time that is more cumbersome and having them eagerly there reliable is usually what I want anyways.

the__alchemist 4 days ago | parent | prev [-]

Likewise. I'm commenting based on my position:

  - Rust Fanboy; use it in several domains (embedded, PC applications, bio/chem)
  - Web dev is the main thing I still use Python for, as there's nothing on Django's level.
Of interest: I am not a fan of Async in rust. I get that for web stuff it is a suitable model, but I still don't like it for no original reasons. As you stated, I don't feel like this is solving the missing aspects, e.g. auto migrations, admin, email, auth, etc.
m4tx 2 days ago | parent | next [-]

Shameless plug: the lack of a fully batteries-included framework (with DB, auto migrations, admin, etc.) is one my biggest gripes in Rust - and that's why I've been developing https://cot.rs/ for a while.

carllerche 4 days ago | parent | prev [-]

Migrations: Done with Toasty (https://github.com/tokio-rs/toasty/) which I intended to be integrated tightly with topcoat. You can see a rough roadmap here, which will be posted: https://github.com/tokio-rs/topcoat/issues/104

Better to ship early and hear what people want though :)