Live data from Hacker News

Cot: The Rust web framework for lazy developers

cot.rs

21–30 of 71 posts

Re: Cot: The Rust web framework for lazy developers

#21
post #5

I'd describe this more as a batteries-included Axum, which is fine on it's own. Don't compare it with Django in this stage, because if I'm being honest, the examples aren't very snappy. I love the idea and I've toyed around with a Symfony/RoR framework in Rust, but other projects like loco.rs are already doing god's work, so I saw no reason to design another wheel.

The README itself says it should feel familiar to Django, which it certainly does from a developer API perspective based on my cursory review of the guide

I think Rails caters to a specific type of audience. Personally, I hate the idea of "scaffolding" my app. I'm fine just writing that plumbing code and seeing how all the pieces interact.

And I never understand this "just accept the status quo" take. If we all did that, we'd still be nomads living in caves.

Re: Cot: The Rust web framework for lazy developers

#23
post #7

> ORM integration I don't trust a web framework that's opinionated about how I use my database. It's very hard to get a web framework right, and it's very hard to get an ORM right. Getting both right is nearly impossible. In a situation like this, try to be the best web framework you can be, and then gravitate towards whatever ORM(s) becomes popular. Take a look at Express for Node.js. It's my favorite web framework…

Opinionated frameworks are very useful. They create well-worn paths that others have tried before.

Every python flask environment I've ever seen has been a bespoke configuration with some selection of the massive combinatoric space that flask presents to folks.

Contrast that with python Django or Ruby on Rails where opinions abound, but you can escape the well worn path if you _need_ to.

Re: Cot: The Rust web framework for lazy developers

#24
post #12

I really wish Rust projects would stop using the term "blazing speed". It is almost like a meme already. You can write slow code in Rust pretty easily, so speed is something extra. And I am a Rust developer... Seeing this term makes me cringe every time.

Ditto for "type safety". This always feels like reaching for onnnne more feature on these project hype sites. "I don't expose the public API as Any!" feels about on the level of "has documentation"... which they also pitch as a feature.

Re: Cot: The Rust web framework for lazy developers

#25
post #7

> ORM integration I don't trust a web framework that's opinionated about how I use my database. It's very hard to get a web framework right, and it's very hard to get an ORM right. Getting both right is nearly impossible. In a situation like this, try to be the best web framework you can be, and then gravitate towards whatever ORM(s) becomes popular. Take a look at Express for Node.js. It's my favorite web framework…

> Rust is not a language for lazy developers.

I am one, and Rust absolutely can be.

> Lazy developers won't fight with the borrow checker.

You don't fight the borrow checker when writing web code. The request flow is well suited for rarely, if ever, testing the borrow checker.

> Instead, think more critically about why a Rust developer would need a web framework

The same reason anyone would need a web framework. Anything ranging from bullshit hack to high SLA service.

I'm finding Rust to be a drop-in Go and Python replacement for HTTP. It's really good at this use case, and it's certainly something you can be very lazy about with modern Rust web frameworks.

Re: Cot: The Rust web framework for lazy developers

#26
post #17
post #7

> ORM integration I don't trust a web framework that's opinionated about how I use my database. It's very hard to get a web framework right, and it's very hard to get an ORM right. Getting both right is nearly impossible. In a situation like this, try to be the best web framework you can be, and then gravitate towards whatever ORM(s) becomes popular. Take a look at Express for Node.js. It's my favorite web framework…

Rust already has several server frameworks that are relatively low-level network plumbing, and leave figuring out everything else to the user. If that's what you like, you can pick and choose from all the existing tools. The Rust's ecosystem is now missing its Rails or Django. This is an attempt to make something for those "lazy" devs who don't want to write their own cookie parsing middleware, and figure out how to…

> Rust already has several server frameworks

The incredible proliferation of Rust web frameworks should be an almost blinding beacon advertising how well-suited Rust is for web backend development.

The biggest takeaway that anyone new to Rust or new to Rust-on-backend should have: Rust absolutely rocks for backend development. It's getting a tremendous amount of attention, people are trying a lot of things, and it's crystalizing as a major backend powerhouse.

You can be just as performant in Rust as you can in Go, or frankly, Python, and the result is super typesafe, super ergonomic, and blindingly fast. Google recently published a paper that said as much.

Rust already has several Python Flask equivalents (Actix/Axum), and it's waiting on its Rails/Django framework.

For anyone scared of Rust or the borrow checker: due to the nature of HTTP services and request flow logic, you almost never bump into it when writing backend Rust. But if you ever need to write anything with multiple hand-rolled threads or worker pools, you can. Rust opens up a lot of interesting possibilities, such as rich in-memory databases. But you certainly don't have to use these powers either if you don't need them.

Re: Cot: The Rust web framework for lazy developers

#27
post #25
post #7

> ORM integration I don't trust a web framework that's opinionated about how I use my database. It's very hard to get a web framework right, and it's very hard to get an ORM right. Getting both right is nearly impossible. In a situation like this, try to be the best web framework you can be, and then gravitate towards whatever ORM(s) becomes popular. Take a look at Express for Node.js. It's my favorite web framework…

> Rust is not a language for lazy developers. I am one, and Rust absolutely can be. > Lazy developers won't fight with the borrow checker. You don't fight the borrow checker when writing web code. The request flow is well suited for rarely, if ever, testing the borrow checker. > Instead, think more critically about why a Rust developer would need a web framework The same reason anyone would need a web framework. Anyt…

As someone who has written a fair bit of web service code in Rust over the last 5 years or so, this is all correct.

Re: Cot: The Rust web framework for lazy developers

#28
post #5

I'd describe this more as a batteries-included Axum, which is fine on it's own. Don't compare it with Django in this stage, because if I'm being honest, the examples aren't very snappy. I love the idea and I've toyed around with a Symfony/RoR framework in Rust, but other projects like loco.rs are already doing god's work, so I saw no reason to design another wheel.

The README itself says it should feel familiar to Django, which it certainly does from a developer API perspective based on my cursory review of the guide I think Rails caters to a specific type of audience. Personally, I hate the idea of "scaffolding" my app. I'm fine just writing that plumbing code and seeing how all the pieces interact. And I never understand this "just accept the status quo" take. If we all did t…

So use axum and do whatever you want? Or better yet, hyper?

Re: Cot: The Rust web framework for lazy developers

#29
post #25
post #7

> ORM integration I don't trust a web framework that's opinionated about how I use my database. It's very hard to get a web framework right, and it's very hard to get an ORM right. Getting both right is nearly impossible. In a situation like this, try to be the best web framework you can be, and then gravitate towards whatever ORM(s) becomes popular. Take a look at Express for Node.js. It's my favorite web framework…

> Rust is not a language for lazy developers. I am one, and Rust absolutely can be. > Lazy developers won't fight with the borrow checker. You don't fight the borrow checker when writing web code. The request flow is well suited for rarely, if ever, testing the borrow checker. > Instead, think more critically about why a Rust developer would need a web framework The same reason anyone would need a web framework. Anyt…

It's absolutely not true, the moment you're out of http hello word, and you have more serious logic about data that you need to manipulate / modify you will fight the borrow checker, that's why a lot of people do a lot of rc / arc refcell.

And then the async implementation.

Re: Cot: The Rust web framework for lazy developers

#30
post #29
post #25

Earlier quoted context omitted.

> Rust is not a language for lazy developers. I am one, and Rust absolutely can be. > Lazy developers won't fight with the borrow checker. You don't fight the borrow checker when writing web code. The request flow is well suited for rarely, if ever, testing the borrow checker. > Instead, think more critically about why a Rust developer would need a web framework The same reason anyone would need a web framework. Anyt…

It's absolutely not true, the moment you're out of http hello word, and you have more serious logic about data that you need to manipulate / modify you will fight the borrow checker, that's why a lot of people do a lot of rc / arc refcell. And then the async implementation.

I’m writing a web app at work and I have one Arc and no Rc or RefCell.
Post reply on HN