Hacker News new | past | comments | ask | show | jobs | submit login

Like trait implementations, and trait objects.





That’s fair, trait objects do cause a table to be generated, but they don’t support inheritance and subjectively I think they’re used less often than the OOP features of c++ that lead to vtable-based dynamic dispatch. (Traits are extremely common in rust, but dyn trait objects somewhat less so)

Doesn't matter how common, the feature is there, and although we aren't yet that far, might even differ across implementations.

Also trait inheritance exists, enforced via trait bounds, what Rust doesn't support is class inheritance.


> Doesn't matter how common

Yes it does, if your concern is “how often do I encounter code where I can’t predict or control what it actually does on the hardware”.


Any time there is a compiler implementation that has to provide support for translating such features into machine code.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: