3 ms·
Rust has gc, no?
by empath75 10y ago
Rust has gc, no?
- colejohnson66 10y agoDepends on your Rust implementation. You can have an implementation without one and use it to make, say, an operating system.
- steveklabnik 10y agoThere is only one implementation of Rust, and it does not have tracing GC. The language does not include semantics for one, so it would be an extension of the language.
- colejohnson66 10y agoRight. I had that backwards. (I don't program Rust)
- TheDong 10y ago> I don't program Rust If you don't know anything about rust, you shouldn't respond to a question about rust.
- dcsommer 10y agoNot in the mandatory runtime overhead, cycle collection, or non-deterministic pausing senses of the word.
- dignan 10y agoNo, it does not. It does allow you to implement it if you want though: https://github.com/Manishearth/rust-gc https://github.com/Manishearth/rust-gc
- 404-universe 10y agoNot really, no. You could implement one with e.g. reference counting, but one is not provided for you by default.
- lossolo 10y agoIt has reference counting for some of the constructs which is a form of garbage collection and it has runtime overhead. Like shared_ptr in c++.
- tomjakubowski 10y agoThis is a misleading comment. A Rust program may use reference counting by explicitly wrapping some value in Rc<> or Arc<>; the standard library provides these generic types. There are no "constructs" built in to the language or standard library that require the use of reference counting.
- lossolo 10y agoI wrote it's like shared_ptr which is also construct in C++ standard library, what is misleading here? You don't need to use it also in C++ and I did not wrote that you need to use it in Rust also, you disagree with something that I didn't wrote. PS. Pozdrawiam rodaka.
- Ygg2 10y agoIt has optional RC type. It had GC as core part of language, about six or more years ago?