2 ms·
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 r
by dgb23 4y ago
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.
- therockhead 4y ago> 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.
- drogus 4y agoAs @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.