←back to thread

239 points ivankra | 1 comments | | HN request time: 0.317s | source
Show context
fgallih[dead post] ◴[] No.45945356[source]
[flagged]
chiffaa ◴[] No.45945530[source]
> who in the fuck would write a garbage collector using garbage collected Rust?

Rust is not garbage collected unless you explicitly opt into using Rc/Arc

replies(2): >>45945727 #>>45946167 #
oconnor663 ◴[] No.45945727[source]
I still wouldn't call it GC in that case. It's pretty much exactly the same as std::shared_ptr in C++, and we don't usually call that GC. I don't know about the academic definition, but I draw the line at a cycle collector. (So e.g. Python is GC'd, but Rust/C++/Swift are not.)
replies(1): >>45945835 #
1. cmrdporcupine ◴[] No.45945835[source]
I consider reference to be garbage collection, and so do most CS textbooks. However Rc/Arc/shared_ptr are GC facilities used (often sparingly) inside predominantly non-GC'd languages, so, yeah, I wouldn't say Rust "is" or "has" GC. It has facilities for coping with cleanup, both RAII and GC.