News for hackers. Stuff that matters.
Re:The Rust compiler has gotten faster again by skohan on Friday November 12, 2021 @02:01AM (#29196969)
Swift doesn't have tracing GC, but to be pedantic automatic reference counting is a form of GC.

But that only goes for reference types. For value types you're correct that both languages use mostly static memory management.

I guess in that sense you'd have to consider Rust as a gc'd language as well: the only difference really is that you have more fine-grained control over which mode of reference counting is being used for a given object.

Re:The Rust compiler has gotten faster again by wahern on Friday November 12, 2021 @02:47AM (#29197174)
See also "A Unified Theory of Garbage Collection", https://researcher.watson.ibm.com/researcher/files/us-bacon/...

> We present a formulation of the two algorithms that shows that they are in fact duals of each other. .... Using this framework, we show that all high-performance collectors (for example, deferred reference counting and generational collection) are in fact hybrids of tracing and reference counting.

...

> For every operation performed by the tracing collector, there is a corresponding "anti-operation" performed by the reference counting collector.

...

> We have shown that tracing and reference counting garbage collection, which were previously thought to be very different, in fact share the exact same structure and can be viewed as duals of each other.

Re:The Rust compiler has gotten faster again by pjmlp on Friday November 12, 2021 @02:33AM (#29197118)
Chapter 5 of the GC Handbook, one of the major CS references in GC algorithms.
Re:The Rust compiler has gotten faster again by mirekrusin on Friday November 12, 2021 @05:45AM (#29197988)
GC is standalone runtime that does tracing and deallocates memory at some arbitrary time. Are you really claiming that using C++'s smart pointers is using GC? I think you're conflating semi/automatic memory management with GC.
Re:The Rust compiler has gotten faster again by pjmlp on Friday November 12, 2021 @06:17AM (#29198148)
You're conflating tracing GC algorithm with GC as CS concept.

Regarding C++ smart pointers, if you manually call them like in std::shared_ptr<>(), no.

If the runtime calls it for you like on C++/CX or compiler blessed types like _com_ptr_t, then surely.

Re:The Rust compiler has gotten faster again by mirekrusin on Saturday November 13, 2021 @01:14AM (#29207848)
ARC in Swift doesn't have runtime part, retain/release code is injected at the compile time. It doesn't have ie. cycle detector running periodically or anything like that. If you define this setup as GC then by this definition Rust's borrow-checker is also a GC because it works the same way - by injecting static code during compilation (but has different rules).