Re:Show HN: Welcome, Cot: the Rust web framework for lazy de...
by ldng on Tuesday February 18, 2025 @01:51PM
(#43093576)
I would love a Django clone in Rust that does NOT do async.
Dead simple to debug instead of performance oriented.
[ Parent
| on HN ]
Re:Show HN: Welcome, Cot: the Rust web framework for lazy de...
by m4tx on Tuesday February 18, 2025 @02:17PM
(#43093852)
That's actually a very good point. I was thinking a lot about whether to make async a requirement. Given that sync code is often easier to reason about and debug and Cot tries to be developer-friendly, I'm leaning towards "sync by default, async when you need to", but I'll need to explore this more. Thanks for this thought!
Re:Show HN: Welcome, Cot: the Rust web framework for lazy de...
by ygouzerh on Tuesday February 18, 2025 @02:13PM
(#43093819)
I just had an issue yesterday in my company where a backend keeps crashing, because a function blocking the main thread, which means that the healthcheck endpoint was not responding... Async is definitely a needs
Re:Show HN: Welcome, Cot: the Rust web framework for lazy de...
by throwway120385 on Tuesday February 18, 2025 @04:56PM
(#43095635)
There are two competing use cases for web frameworks. In embedded systems you might have one or two users for a web page, and the page exists because you don't want to put a display on the device. That's where a synchronous approach really shines because it's easy to reason about and therefore doesn't break very often. Contrast that with a traditional web site with a backend, frontend, and thousands or millions of users. In that case, async code is easier to reason about because each visitor probably isn't interacting with the same elements of your model at the same time, and if they are you can define how those interactions work and enforce synchronization using the database. So it's not an either/or, but rather two approaches that address totally different situations.
Re:Show HN: Welcome, Cot: the Rust web framework for lazy de...
by hu3 on Tuesday February 18, 2025 @05:48PM
(#43096117)
Usually non-async frameworks spawn some kind of thread so that it never blocks or crashes the main process regardless of what happens to the threads.
I know Go frameworks are usually like that. They spawn green threads and you can write HTTP handlers using simpler sync code to handle requests without worry.
Re:Show HN: Welcome, Cot: the Rust web framework for lazy de...
by ldng on Thursday February 27, 2025 @03:31AM
(#43192421)
Async is not "definitively a need". It's a fad from browser JS where it is actually needed. Async would not have solved your issue, just delayed it until OOM and that would have make debugging it harder. Case in point.
Re:Show HN: Welcome, Cot: the Rust web framework for lazy de...
by brink on Tuesday February 18, 2025 @02:02PM
(#43093700)
No threading either. Just a single thread serving one client at a time.
Re:Show HN: Welcome, Cot: the Rust web framework for lazy de...
by the__alchemist on Friday February 21, 2025 @03:52PM
(#43132827)
This is exactly what I'm looking for. Rust is my favorite languages in many domains; I use Python and Django for web backends due to the immature rust ecosystem there. I am not a fan of Async for various reasons, so: Batteries-included web backend + rust + not-Async would be amazing!