[rust-dev] "Virtual fn" is a bad idea

Oren Ben-Kiki oren at ben-kiki.org
Tue Mar 11 14:30:29 PDT 2014


I can't help but feel that forcing the "single inheritance of fast field
access" and "inheritance of trait functions" into one mechanism would be
regrettable.

Would https://github.com/mozilla/rust/issues/10491 address all the
requirements? If not, why?


On Tue, Mar 11, 2014 at 10:52 PM, Brian Anderson <banderson at mozilla.com>wrote:

> The downsides you list are all more or less applicable to this design,
> indeed. We are seeing real requirements in real code that indicates that
> the current abstraction facilities provided by Rust are efficient enough
> for certain demanding use cases (the DOM in particular).
>
> Here are the identified requirements:
>
>     tree of types (single inheritance)
>     downcasting
>     thin pointers
>     cheap field access
>     easy upcasting
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140311/cabf2b6e/attachment.html>


More information about the Rust-dev mailing list