4 ms·
I don't use Rust just because I want to avoid GC. I also use it for algebraic data types, compile time elimination of data races, sophisticated polymorphism, a
by burntsushi 10y ago
I don't use Rust just because I want to avoid GC. I also use it for algebraic data types, compile time elimination of data races, sophisticated polymorphism, a clear and simple module system, excellent tooling in the form of Cargo and an unrelenting focus on providing abstractions with as little overhead as possible.
(I've used Go and Rust daily for the past few years. I love them both.)
- santaclaus 10y ago> I don't use Rust just because I want to avoid GC. Go that is?
- burntsushi 10y agoHmm, not sure I understand? Re-reading, perhaps my phrasing wasn't clear. What I meant was that I use Rust, and it's not simply because it lacks GC. There are lots of other good reasons too. To be even clearer: I don't think Rust's value proposition depends on whether you absolutely must avoid GC or not.
- empath75 10y agoRust 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?
- jjnoakes 10y agoNo. He is saying he uses rust to avoid GC, but not just to avoid GC.
- voidlogic 10y agoGood point. I agree there are other reasons to use Go, I what mean is that unless I have a project that gets a lot of bang for the buck out of those, the KISSness of Go wins out over those nice features and their correlated complexity. GC was just at the forefront of that list of features.
- Ericson2314 10y agoThere's simple, and there's anti-intellectual. Go would be the latter.
- oblio 10y agoWell, in many respects Basic, PHP, Javascript, Java all had various forms of "anti-intellectualism" baked. They lost some of them along the way. Still, the fact that all those languages are in the top 10 of programming languages kind of says that people don't really care.
- _callcc 10y agoGo is against the sort of programming that builds up conceptual dream worlds of gratuitous abstraction and needless complexity. When that's the only way you want to think, Go will indeed seem anti-intellectual.
- tigershark 10y agoA modern programming language without any whatsoever support for generics from my point of view is just extremely bad, for someone else can very well be proof of anti-intellectualism.