Hacker News new | ask | show | jobs
by cyber_kinetist 1555 days ago
There are lots of things C++ can do where Rust can't (ex. templates in C++ are much more powerful than Rust's generics as of now), and lots of things Rust can do where C++ can't (ex. handling memory ownership in a much more secure way, hygienic and procedural macros). You might still want to use C++ for any sort of complex programming involving numerical computation and graphics (Rust is getting there but is still a bit weak in some aspects), but for any mission-critical service related to the Web you would be more inclined to choose Rust (because of async support, and since C++ is horribly insecure for any sort of web programming).
1 comments

Note that generics in Rust are not intended to replicate everything that C++ templates do, Rust has macros for the more complex uses. There's also a lot of vaporware coming from C++ standard development proposals about "metaclasses" and "reflection" being added to some future version of C++, this would basically be their way of doing the equivalent of hygienic macros in Rust. C++ has also added recent support for parallel and heterogenous programming (GPUs, accelerators etc.) for which Rust has no equivalent as of yet.