Remix.run Logo
▲ pebal 8 hours ago

There is no connection. Rust has ARC which performs worse than the tracing GC.

▲saagarjha 5 hours ago | parent [-]

Than Go's GC? I think that is fairly unlikely in most cases.

▲pebal 5 hours ago | parent [-]

It depends on the workload. ARC can be more expensive than tracing GC, especially with heavily shared objects.

But my main point was that the presence of a GC has nothing to do with how close a language is to the metal. Memory management strategy and low-level capabilities are two separate things.

▲sreekanth850 4 hours ago | parent [-]

I gave two separate reasons. Rust provides explicit control over memory allocation and management, and it has no garbage collector.

▲pebal 2 hours ago | parent [-]

Rust could just as well have an optional tracing GC for shared ownership instead of ARC, potentially improving performance rather than reducing it. Having a GC doesn't inherently make a language slower.

▲josephg an hour ago | parent [-]

> a GC doesn't inherently make a language slower.

Yeah but let's be honest; GC languages (Go, Java, C#) usually are slower than systems languages. Systems languages just give you more, low level control over the computer from within your program. You can use that control to improve performance. Eg, you can control data locality, memory access patterns, the emitted assembler, and way more stuff.

Of course you're right - if you misuse arc, you can make your program slow. So don't misuse arc then. Rust gives you lots of options for structuring memory. If you choose badly, that's on you.