News for hackers. Stuff that matters.
Re:Async Rust: What is a runtime? how Tokio works under the ... by bongobingo1 on Saturday July 16, 2022 @12:40PM (#32119664)
Is the overhead going to matter if your content to block anyway? Surely any threading etc constructs are tiny compared to wire time, etc.
Re:Async Rust: What is a runtime? how Tokio works under the ... by ibraheemdev on Saturday July 16, 2022 @12:48PM (#32119759)
Blocking I/O+threads can actually scale very well now, and with block_on you get the worst of both worlds, but yeah, I agree that most people are probably fine with it.
Re:Async Rust: What is a runtime? how Tokio works under the ... by vbezhenar on Saturday July 16, 2022 @01:23PM (#32120055)
Most people fine with python. Those who come to Rust are not fine with overhead.
Re:Async Rust: What is a runtime? how Tokio works under the ... by mcronce on Saturday July 16, 2022 @02:06PM (#32120430)
This assumes that people only use Rust for the performance. I don't think that's strictly true.

95% of what I write isn't performance-critical or even, really, performance-relevant. I still choose Rust for the vast majority of projects for ergonomic and correctness reasons.

Re:Async Rust: What is a runtime? how Tokio works under the ... by adwn on Saturday July 16, 2022 @02:29PM (#32120591)
You're spot on. I recently chose Rust over Python for a very small program which reads a JSON (or Hjson) file, does some checking and processing, and writes the results to a different JSON file, because Rust has serde, proper static type checking, algebraic data types, and other features that made it more productive than Python (!!!) for that specific use case. Performance wasn't even a consideration, I made judicious use of clone() and run it in debug mode.
Re:Async Rust: What is a runtime? how Tokio works under the ... by dagmx on Saturday July 16, 2022 @02:36PM (#32120658)
Serde is such an awesome library. Having to decode serialized data in the other languages (Swift, C++, Python) I write is such a bear after using serde.

Swift comes closest with codable/decodable but it's often still lacking the ergonomics of serde, especially the attribute options per field

Re:Async Rust: What is a runtime? how Tokio works under the ... by dagmx on Saturday July 16, 2022 @02:31PM (#32120610)
Some people who come to rest may not be fine with it.

A lot of people come to rust for other reasons, like compile time safety checks etc...

But most importantly, the delta between the performance of block_on and not, versus block_on and Python are massively different. You can write inefficient rust and still have a huge win over Python.