I'm actually confused about what "object inheritance" means in Rust.
I understand that Rust makes a very clear separation between behaviour (traits) and data (structs). So, when I saw mentions to "virtual structs" implementing or not implementing virtual functions, I had the /sensation/ that these very distinct concepts are starting to get mixed in ways that I find a bit confusing from the user's perspective. Thanks Richard Gomes http://rgomes.info http://www.linkedin.com/in/rgomes mobile: +44(77)9955-6813 inum <http://www.inum.net/>: +883(5100)0800-9804 sip:rgo...@ippi.fr On 12/03/14 19:33, Daniel Micay wrote: > On 12/03/14 09:21 AM, Niko Matsakis wrote: >> I personally think that offering some kind of virtual structs fits >> completely within Rust. We've always tried to avoid "one size fits >> all" thinking -- in real life there are performance tradeoffs, and you >> often can't cover the entire space with a single design. This is why >> we offer multiple pointer types, closures vs procs, and so forth. > Rust is already a large language, and the interactions between many of > the features are subtle or poorly defined. There's a complexity cost for > every feature that's added. It gets harder for a single programmer to > learn the language and makes it less feasible for even an experienced > Rust programmer to grasp it all. The compiler will have more bugs, so > the safety guarantee won't be as strong. > > Variadic generics, optional/keyword parameters, higher-kinded types, > single inheritance, refinement types, dynamically sized types, > compile-time function evaluation, generic literals and more are all > proposed as useful features. I think there's the potential for Rust to > be a more complex language than C++, if it's not already. > >> In general, I hope that Rust programmers will reach for traits first. > I think we can expect that programmers will reach for familiar concepts, > and for many (most?) that will mean using inheritance. It will change > how code is written in Rust, and will be seen in many third party libraries. > > I never plan on using the feature and I'll certainly avoid libraries > requiring me to use object inheritance and override methods. Others will > make heavy use of this feature. When I'm writing C++, I rarely find > libraries using what I consider to be a sane subset of the language. > When there isn't a Boost library for it, I just end up using a C library > and building a C++11 wrapper around it myself. I can definitely see this > happening to Rust if it picks up controversial features like object > inheritance. > > > > _______________________________________________ > Rust-dev mailing list > Rust-dev@mozilla.org > https://mail.mozilla.org/listinfo/rust-dev
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev