Re:My Vision of D’s Future
by pornel on Tuesday October 15, 2019 @04:05PM
(#21263069)
More specifically, Rust doesn't have inheritance of data. It uses composition and can simulate inheritance of interfaces. That suffices for Rust programs, but gets awkward quickly with some classic OOP-heavy design patterns.
Despite superficially similar angle bracket syntax, C++ templates and Rust generics are very different and incompatible in all but most trivial cases. D templates can get closer.
Rust also lacks many C++-isms: there are no copy/move constructors, no custom code can run on assignment, operator overloading is more conservative, there's no life before main(). Error handling, iterators, and strings are done differently.
Even if C++ could magically work in Rust, it'd be weird. OTOH D feels much like a rewrite of C++.
Despite superficially similar angle bracket syntax, C++ templates and Rust generics are very different and incompatible in all but most trivial cases. D templates can get closer.
Rust also lacks many C++-isms: there are no copy/move constructors, no custom code can run on assignment, operator overloading is more conservative, there's no life before main(). Error handling, iterators, and strings are done differently.
Even if C++ could magically work in Rust, it'd be weird. OTOH D feels much like a rewrite of C++.