4 ms·
> Rust is the only modern language on our list with no garbage collection. Ridiculous. `Rc` exists for one purpose: reference counted data. When all the refere
by ironmagma 6y ago
> Rust is the only modern language on our list with no garbage collection.
Ridiculous. `Rc` exists for one purpose: reference counted data. When all the references are gone, it will be freed. That’s garbage collection by definition.
I already knew this article had dubious judgment when they knocked C++, the daily driver for performance-obsessed game developers, down because of lack of concurrency support though.
- jrimbault 6y agoThere are lots of [little to big] factual errors in this piece. My favorite error is also rust related : > Rust has no built-in support for immutable data structures. This piece is flamebait.
- throwaway17_17 6y agoI agree with your characterization of the article and had an initial head scratching with regard to that rust statement, in the context of the article it is correct. Rust certainly has built-in support for immutable data, it lacks what the author is calling ‘support for immutable data structures’. In particular, the author only seems to be considering support for persistent, immutable data structures, as referenced in all the functional language examples. Rust does not have any concept of an immutable list which is changed by simply adding a pointer to the unchanged part of the list to some new derived list. I think the author should have been more explicit in qualifying the immutable characteristic as persistent all the way through the article.
- ironmagma 6y agoArguably, the existence of Cell destroys any notion of immutability. It depends on your worldview; if an escape hatch of any kind makes immutability a lost cause, then this point has merit. But I don't see why that would be such a big deal, since the majority of the language is immutable by default.
- klodolph 6y ago> That’s garbage collection by definition. It depends on your definition of garbage collection though, doesn’t it? People often make a distinction between reference counting and garbage collection. Even though you can use reference counting in a GC'ed system (example: CPython), in most conversations people talk about reference counting as something different from garbage collection—for example, Objective-C’s ARC is seen as a different memory management technique from GC (you can have one or the other). I think most people would not describe Rc or std::shared_pointer to be garbage collection.
- ironmagma 6y agoI’d say that’s a faulty distinction, especially in a review of programming languages. Rust’s lack of a mark and sweep with GC pauses while still allowing reference counting is a feature rather than a detractor, especially when half of the issues putting e.g. Java into production are GC tuning related. It’s a language criticism in the same category as marking down Java because of its object oriented nature. If you’re finding that as a fault of Java, you’ve entirely missed the idea of the language.
- klodolph 6y ago> Rust’s lack of a mark and sweep with GC pauses while still allowing reference counting is a feature rather than a detractor… Gonna stop you right there, because you’re arguing about which type of memory management is BETTER. That conversation is not one that’s going to come to a conclusion on this website because outside of certain scenarios where you might be forced to choose reference counting or garbage collection, in general, it’s just a tradeoff. Reference counting is generally slower and less accurate, garbage collection uses more memory and has poorer latency guarantees. ¯\_(ツ)_/¯ > If you’re finding that as a fault of Java, you’ve entirely missed the idea of the language. I don’t understand what you mean by that. Java is a product of the 90s and “everything is a class, classes encapsulate mutable state, subtype polymorphism” fell out of that. It was a bit of a fad, and the fad got baked into the language.
- ironmagma 6y ago
- alushta 6y agoNot to mention that Rust is a ML based language and not a C based one. I am an OCaml programmer, and was writing significant Rust code in less than a month. It makes me wonder if the author has actually used Rust at all. In fact, I picked up Rust because the original Rust compiler was written in OCaml!