3 ms·
I get that feeling, too. My general comment is that web back-end stuff should be written in Go. Go is designed for exactly that. Goroutines are lightweight but
by Animats 5y ago
I get that feeling, too. My general comment is that web back-end stuff should be written in Go. Go is designed for exactly that. Goroutines are lightweight but preemptable, so you don't have the async vs. thread problem at all. There's only one way to do it. Most of the Go libraries you need for web back-end are well-exercised, because they were written at Google and are used internally.
Writing in Rust takes more engineering effort and is less agile. You can code yourself into a corner which requires considerable rewriting, or unsafe code, to escape.
What I'm writing in Rust is a metaverse client. These are not common yet. They have both the real-time problems of a game client and the unexpected content-driven loads of a web browser. The goal is to keep the frame rate constant as a stream of update transactions comes in, perhaps hundreds per second. The transactions modify the scene graph and change what's on screen. So refresh is in one high-priority thread, while updating is in other low priority threads. Overload bursts happen routinely and have to be dealt with, updating near and large things first. In MMOs, such overloads are usually detected and prevented during game design, but a metaverse viewer does not have that luxury. Existing clients tend to choke and stall on overload, but with enough CPUs working on the problem, that can be overcome.
It's a fun problem. It doesn't have the shape of most common applications.
- jacquesm 5y agoYes, I can see that as a good match for Rust. When you started to describe it I thought 'Erlang' but as the description progressed it clearly is a bad match for Erlang due to the performance requirements. But typical web stuff: Go or even Java would seem to be a much better choice than Rust, for the same reasons I would not write a typical web service in C or C++.