7 ms·
TL;DR: He is happy. Better toolchain (environment manager, package manager, etc) Macros are easier to do with Rust (than in Scala). IDE: happy with MS Visua
by flavio81 9y ago
TL;DR:
He is happy.
Better toolchain (environment manager, package manager, etc)
Macros are easier to do with Rust (than in Scala).
IDE: happy with MS Visual Studio Code
Syntax is not too different.
Type system: He likes it.
Calls C code with a similar syntax than doing it with Scala
Rust allows you more control on how to use your memory allocation. (Or forces you to take control).
-------
My own take on Rust (haven't used the language yet, only looked at specs) is that it appears to be a more "sane", state-of-the-art version of C++, streamlined, without all the cruft and all the legacy. And with a much better object oriented system based on Traits.
- look_lookatme 9y agoDon't let the Rust fanboys catch you calling it OO.
- saghm 9y agoWhy? OO doesn't have to have inheritance.
- steveklabnik 9y agoThe second edition of the book has a chapter https://doc.rust-lang.org/nightly/book/second-edition/ch17-00-oop.html https://doc.rust-lang.org/nightly/book/second-edition/ch17-0... I personally don't feel Rust fits into either of the two big schools of OOP, but that doesn't mean that it's not OO. Part of the problem with OO is that the definitions are hard.
- saghm 9y agoI tend to think of OO as a spectrum rather than a binary thing, and I think that Rust certainly belongs somewhere on it. I'm not convinced there's any language that can be considered "completely object-oriented"; Java has primitives, and Python, while considering everything an object, is perfectly content to let you use functions and variables without writing a single class. JavaScript doesn't even have classes, but I think it still can be considered to be at least partially OO. I might just have a more liberal than average interpretation of what OO means, though.
- jholman 9y agoI think that's actually an unreasonably strict interpretation of OO, actually. First, lack of classes is no reason to eliminate JS, it's not Class-Oriented programming. (not that I think JS is particularly OO; certainly not "completely OO") Second, it's not Object-Only programming, so I'm not sure why you'd rule out any language with primitives. Much as I detest Java-style OO, I think it's very clear that its orientation is towards objects. And third, even if you want to stick to those two rules, what about Ruby? Every value is an object, it has classes, and you can't write functions (only methods).
- saghm 9y agoI didn't mean to give the impression that I didn't consider JS to be object-oriented, although I realize now I wasn't quite as clear as I originally intended. When I said "at least partially OO", I meant that I wouldn't agree with an assertion that said JS isn't OO at all, not that it's only partially OO. After all, Rust doesn't have classes, and my original point was that I think Rust is somewhat OO. Similarly, I wasn't saying that Java isn't OO either; I was attempting to make the point that I could see plausible arguments saying that either Python or Java is "more OO" than the other. Personally, I consider Java to be more OO than Python, but I'm not sure I could make a compelling counterargument to the idea that Python is more OO due to everything being an object. As for Ruby, I'm not sure I understand what you're saying; Ruby lets you just write top-level functions and variables just like you can in Python. I also think you might have misinterpreted my giving examples as being "rules"; I certainly can't come up with any objective rules to determine whether a language is OO or not. I must not have made myself very clear, but the main idea behind what I was trying to convey is that I don't think anything is "completely" object-oriented and that plenty of languages fall somewhere on the spectrum of OO languages.
- matt_kantor 9y ago> As for Ruby, I'm not sure I understand what you're saying; Ruby lets you just write top-level functions and variables just like you can in Python. I don't know much about Python, but in Ruby top-level bindings are just syntax sugar for attaching things to an object called "main". [0] [0]: https://codequizzes.wordpress.com/2014/04/23/rubys-main-object-top-level-context/ https://codequizzes.wordpress.com/2014/04/23/rubys-main-obje...
- look_lookatme 9y agoI agree, but that doesn't matter to a certain segment of the Rust community. They will go to great lengths, including redefining what OO is, to disassociate their language from OO for whatever reason.
- saghm 9y agoI haven't personally seen this before, but I can't say for sure I know it doesn't happen
- andrewflnr 9y agoSometimes on say, /r/rust, they get questions from people wondering how to "do OOP" with Rust, by which they tend to mean "traditional", inheritance-style OOP. This leads to Rustaceans having to explain "no, that's not exactly how it works here". I'm not sure that's what GP is talking about, and I can't think of a time when I saw someone really aggressively dissociate from OOP, but it's easy for me to believe that some people might take it too far.
- rkangel 9y ago> And with a much better object oriented system based on Traits Note that Traits are a system for generics specifically. You can have useful OO without generics (C++ is useful without templates, go does't have them at all).
- flavio81 9y agoTraits go a bit beyond generics, in my view. You can say i'm a "smug Lisp coder", but after having used CLOS (Common Lisp Object System), i'd say that generics are one of the most useful things you can have in OOP. With Traits you can separate implementation of certain methods (implementation of Traits) from object definitions. Which for me is excellent, and approaches CLOS' way (in CLOS methods are not directly coupled to a particular object; methods are applied to the combination of one (or more) object(s). In a similar way as English language; where you apply an action involving many subects: "Angel transport his luggage using a car." Here the 'transport' action can't really be bound to the Person class, nor the Luggage class. Perhaps it belongs on the Car class, but with CLOS you can just define "transport" to act on the combination of <actor> <object to be transported> and <vehicle>. "Transport", thus, is a "generic method" and can be defined (implemented) for all kinds of class combinations. With Traits you can achieve something more or less similar, by defining the necessary Traits for each kind of class, to be able to have all of them "transport" harmoniously. So Traits can link (and then impement) the operations performed between classes, without having to bound the code to a particular class.
- lispm 9y agoCLOS: A combination of applicable methods from a generic function is applied to objects.
- saghm 9y agoIn Rust, you can have functions/enums/structs that are generic without traits, and you can have traits that aren't generic. Generics and traits are orthogonal features.
- rkangel 9y ago
- phkahler 9y ago>> it appears to be a more "sane", state-of-the-art version of C++ Some time ago I commented on how horrible C++ has become and said it would be nice if someone made a new language with all the efficiency and features of C++ but nicer to program in. Someone said essentially "that's Rust". You are another confirmation of that. I have yet to take the plunge but hope to some day.
- saghm 9y agoI had a similar conversation with someone who I consider an expert in C++ after a few months of working in C++ for the first time, and I said basically the same thing you did (only already having Rust in mind when I made my comment). To my surprise, he mentioned Rust immediately, instead of my having to bring it up. Having learned C++ after Rust, I had kind of assumed that my view of Rust as a sort of reboot of C++ wasn't going to be shared by someone with so much C++ experience.
- epage 9y agoReboot is a good way to put it. I feel like Rust goes back to C and says "with what we've learned how should C do OOP". I'm excited about Rust. As a 15+ year C++ developer.
- flavio81 9y agoTo be fair, Objective-C has existed since 1984 and it adds nice OOP to C, that is, Smalltalk-style OOP. However, i must say that when I was first introduced to C++, having been totally familiar with C, i thought that Bjarne Strostrostrostrostrostro *** - Program stack overflow. RESET ... Strostroup was a genius. I think C++ was a nice idea, but ended up suffering from the "yeah, let's add this feature too" syndrome. I really wonder if there is one person in the earth that actually knows the whole of the C++14 language.
- twic 9y ago'Nicer' is quite subjective. There are definitely people who won't appreciate Rust's sophisticated type system, functional idioms, or obsessive control over mutability. Not me, though, I love them!
- dewiz 9y agoNTL;RI It's a great post, deserves reading it through to the end