News for hackers. Stuff that matters.
Re:Rust Is Hard, Or: The Misery of Mainstream Programming by dgb23 on Friday June 03, 2022 @05:42AM (#31606188)
If you default to Arc everywhere, aren’t you essentially just implementing a slow GC?

This type of thing comes up of often when people try the language. They re-implement some part of a program, originally written in a fast GC language, and then wonder why it’s slower.

I feel like the power of the language comes through in specific workloads, or when you take the additional time to avoid naive code. That’s why it is so verbose and rich, it gives you more control. And this is something that advocates often clearly state.

Re:Rust Is Hard, Or: The Misery of Mainstream Programming by therockhead on Friday June 03, 2022 @05:47AM (#31606235)
> If you default to Arc everywhere, aren’t you essentially just implementing a slow GC?

Like I posted earlier, you don't do this everywhere, just some sporadic use where it makes life a lot easier. It doesn't have to be all or nothing.

Re:Rust Is Hard, Or: The Misery of Mainstream Programming by drogus on Friday June 03, 2022 @10:32AM (#31608818)
As @therockhead replied already: you won't put every single variable behind `Arc`. It will only be for shared state: queues, handlers that you need to move between threads/tasks etc.