News for hackers. Stuff that matters.
Re:Why Discord is switching from Go to Rust by giornogiovanna on Wednesday February 05, 2020 @01:10AM (#22244412)
Reference counting is a (low-throughput, low-latency) form of garbage collection.
Re:Why Discord is switching from Go to Rust by _ph_ on Thursday February 06, 2020 @03:55AM (#22254566)
The low-latency part might not even be true. RC means that you don't have CPU consuming heap scans, but if you free the last reference to a large tree of objects, freeing them can take quite a lot of time, causing high latencies.
Re:Why Discord is switching from Go to Rust by arcticbull on Wednesday February 05, 2020 @01:32AM (#22244507)
Yes and no. From a theoretical perspective, I suppose that's true, but "garbage collection" tends to mean a non-deterministic collector that does its own thing, and you don't have to think at all about memory. That does not apply to Swift, as of course, you need to understand the difference between strong and weak references. It's unfairly simplistic to couple the two.
Re:Why Discord is switching from Go to Rust by barrkel on Wednesday February 05, 2020 @05:34AM (#22245597)
No, RC is GC.

Most people think of Python as GCed language, and it uses mostly RC.

Any runtime that uses mark & sweep today may elect to use RC for some subset of the heap at some point in a future design, if that makes more sense. The mix of marking GC vs refcounting GC shouldn't affect the semantics of the program.

Re:Why Discord is switching from Go to Rust by staticassertion on Wednesday February 05, 2020 @02:58AM (#22244844)
But it actually is just garbage collection.
Re:Why Discord is switching from Go to Rust by Sean1708 on Wednesday February 05, 2020 @04:20AM (#22245242)
It is but in the context of this discussion it's very clear that they meant a tracing garbage collector, which has a very different cost than atomic reference counting. Or to put it another way: you're technically correct, the worst kind of correct.