Live data from Hacker News

Show HN: Cot: a Rust web framework for lazy developers

mackow.ski

1–10 of 115 posts

Re: Show HN: Cot: a Rust web framework for lazy developers

#2
> The ORM is very lacking at the moment and the automatic migration generator only works with a small subset of possible operations,

I would have hoped that by 2025, new projects would have moved away from ORMs entirely. They really are a useless abstraction layer that always brings tons of trouble and usually makes queries harder to write.

Looking at the first example in the docs

https://cot.rs/guide/latest/db-models/#retrieving-models

    let link = query!(Link, $slug == LimitedString::new("cot").unwrap()).get(request.db()).await?;
I really don't get the point, and that'll certainly get worse with any somewhat non-trivial query.

Why go through all the trouble of reinventing a new DSL when the SQL equivalent would be so much cleaner?

    SELECT * FROM link WHERE slug = 'cot';

Re: Show HN: Cot: a Rust web framework for lazy developers

#7
post #2

> The ORM is very lacking at the moment and the automatic migration generator only works with a small subset of possible operations, I would have hoped that by 2025, new projects would have moved away from ORMs entirely. They really are a useless abstraction layer that always brings tons of trouble and usually makes queries harder to write. Looking at the first example in the docs https://cot.rs/guide/latest/db-model…

As long as it's still possible to also use SQL queries with it it's fine, right? I know some people who prefer using ORMs and some who like writing SQL.

Re: Show HN: Cot: a Rust web framework for lazy developers

#8
post #2

> The ORM is very lacking at the moment and the automatic migration generator only works with a small subset of possible operations, I would have hoped that by 2025, new projects would have moved away from ORMs entirely. They really are a useless abstraction layer that always brings tons of trouble and usually makes queries harder to write. Looking at the first example in the docs https://cot.rs/guide/latest/db-model…

As long as it's still possible to also use SQL queries with it it's fine, right? I know some people who prefer using ORMs and some who like writing SQL.

I don't think it's a good idea to have a mix of both in a codebase, because then you'll have to be good at both - kind of defeats the purpose.

Re: Show HN: Cot: a Rust web framework for lazy developers

#9
post #2

> The ORM is very lacking at the moment and the automatic migration generator only works with a small subset of possible operations, I would have hoped that by 2025, new projects would have moved away from ORMs entirely. They really are a useless abstraction layer that always brings tons of trouble and usually makes queries harder to write. Looking at the first example in the docs https://cot.rs/guide/latest/db-model…

Composability is the often cited benefit. As an example, I can do the following in Active Record (Ruby):

  class Account  { where.not(active_at: nil) }

    belongs_to :user
  end

  class User (born_on) { where(birthdate: born_on) }
  end

  active_users_with_birthdays_today = Account.active.joins(:user).merge(User.born_before(Date.today))
Contrived, of course, but it's not hard to see how you can use these sorts of things to build up record sorting, filtering, etc. Doing this by hand wouldn't be very fun.

Re: Show HN: Cot: a Rust web framework for lazy developers

#10
What is the competitive landscape looking like these days for Rust web frameworks? I couldn't help but feel a bit insecure last time I was exploring the various options because none of them seemed to have the maturity or longevity of frameworks from other languages (for obvious reasons).

Is there one framework that stands out from the rest from an "investment risk" perspective? In other words, if my company is going to choose a framework to build a website, which one has the lowest odds of burning me by becoming abandoned or unsupported?

Post reply on HN