Earlier quoted context omitted.
> OS threads are not significantly different from goroutines in terms of efficiency This is not true for a use case with a lot of connections, additionally context switch cost a lot more now with all side channel attack mitigations on.
People are happily running Rust servers in production using thousands of concurrent threads per second.
Async-std: an async port of the Rust standard library
131–140 of 238 posts
Re: Async-std: an async port of the Rust standard library
#132Earlier quoted context omitted.
> I must be dumb Nope, async really isn't trivial. > I know .await != join_thread(), but doesn't execution of the current scope of code halt while it waits for the future we are `.await`-ing to complete? It doesn't, that's the charm of it. It's best to treat 'await' as syntactic sugar, and to dig in to the underlying concepts. I realise we're not talking C#/.Net, but that's what I know: in .Net, your function might d…
> It's best to treat 'await' as syntactic sugar, and to dig in to the underlying concepts. Slight word of warning: `async/await` is more than just sugar in Rust, it also enables borrowing over awaits, which was previously not possible.
Re: Async-std: an async port of the Rust standard library
#133Earlier quoted context omitted.
People are happily running Rust servers in production using thousands of concurrent threads per second.
I don't doubt that but apparently we have different definitions of a lot . Additionally latency and hardware also matters, I can say that C is doing n things a second while PHP is doing the same but C is running on EC2 micro instance and PHP is running on 2x Intel Xeon Platinum 9282 dedicated machine. C10K problem was not solved by 1:1 model and this is an old problem. C100K+ is what I see in some of production syste…
Re: Async-std: an async port of the Rust standard library
#134Earlier quoted context omitted.
The article explicitly admits that async/await is ergonomically much nicer than explicit futures/promises. But the color problem still remains, one consequence of which is duplication of code and interfaces. Arguing that the problem doesn't exist if you only stick to functions of a single color isn't a rebuttal, it's an admission! But the fact of the matter is async functions have real limitations and costs, which is…
I think the point is that "colored" functions only existed because Rust did not previously have async support. Now that it has async support, new code can be one color: async, while maintaining ergonomics. Maybe new code will be exclusively async and existing code will switch over.
Re: Async-std: an async port of the Rust standard library
#135Earlier quoted context omitted.
> OS threads are not significantly different from goroutines in terms of efficiency This is not true for a use case with a lot of connections, additionally context switch cost a lot more now with all side channel attack mitigations on.
People are happily running Rust servers in production using thousands of concurrent threads per second.
Re: Async-std: an async port of the Rust standard library
#136Anything Rust gets the post to number 1 spot. What makes Rust special that other programming languages don't enjoy ?
Rust is very ambitious and unusually successful at reaching its ambitions. It's efficient like C/C++, but safer. It's modern like Go, but more expressive and open to metaprogramming. It's often as readable as a scripting language, but doesn't depend on garbage collection. It's a young rising star originating from a great company.
I beg to differ. If anything, Rust is often cited as being hard to read.
Re: Async-std: an async port of the Rust standard library
#137Earlier quoted context omitted.
> OS threads are not significantly different from goroutines in terms of efficiency This is not true for a use case with a lot of connections, additionally context switch cost a lot more now with all side channel attack mitigations on.
People are happily running Rust servers in production using thousands of concurrent threads per second.
Re: Async-std: an async port of the Rust standard library
#138Anything Rust gets the post to number 1 spot. What makes Rust special that other programming languages don't enjoy ?
Rust is very ambitious and unusually successful at reaching its ambitions. It's efficient like C/C++, but safer. It's modern like Go, but more expressive and open to metaprogramming. It's often as readable as a scripting language, but doesn't depend on garbage collection. It's a young rising star originating from a great company.
Re: Async-std: an async port of the Rust standard library
#139Re: Async-std: an async port of the Rust standard library
#140How does this relate to Tokio [0]? Why should I choose this new library instead? [0] https://github.com/tokio-rs/tokio
If all you needed from tokio was tokio::net, then async-std could work as a replacement for raw TCP stuff. If you needed the higher-level stuff from tokio like codecs then you'd not have those. Also, anything from the tokio ecosystem like hyper would not work with async-std. Edit: I originally had a first paragraph which was wrong. I mistakenly thought std::net::TcpListener is supposed to impl Read / Write.