Comment by ldng
4 days ago
I would love a Django clone in Rust that does NOT do async. Dead simple to debug instead of performance oriented.
4 days ago
I would love a Django clone in Rust that does NOT do async. Dead simple to debug instead of performance oriented.
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!
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!
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
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.
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.
No threading either. Just a single thread serving one client at a time.