3 ms·
Nitpick : > 1. Removing structs and interfaces (in favor of what? Java-style classes and interfaces?) would make Rust more verbose, less of a systems language,
by soulbadguy 10y ago
Nitpick :
> 1. Removing structs and interfaces (in favor of what? Java-style classes and interfaces?) would make Rust more verbose, less of a systems language, and slower at runtime due to the indirect dispatch.
Classes and interface can be implemented without indirect dispatch...
- pcwalton 10y agoOnly if you monomorphize interfaces—which gives you Rust's traits.
- soulbadguy 10y agoNo. THe fundamental difference is that rust traits cannot convey structural information , classes (java and c++ can)
- steveklabnik 10y agoThere's an open (and desired) RFC for this. It's not likely to happen soon since it's not a super high priority, but I'd be willing to bet it gets merged in the future.
- soulbadguy 10y agoFair enough, as long as we agree that classes/struct in C++/java a quite a different beast than just monomorphic traits.
- steveklabnik 10y agoAbsolutely, you're totally right with regards to today.