Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I disagree, Rust and C++ are very different languages with significant impedance mismatches once you go beyond the common C-like subset. Referencing C++ as a matter of course in docs and blog posts would just cause confusion. If you want a modern language that really is a lot closer to C++ you may want to check out Carbon.


Rust was created as a C++ replacement, borrows the 'zero cost abstractions' motto from C++, relies on RAII for resource management like C++ (not many languages do it), has the same approach to concurrency (in-place mutation guarded by locks), uses the codegen backend that was created for C++. It's mostly a C++ subset with more guardrails.

Edit: RAII


It's nowhere near a C++ subset. The way it works under the hood is quite different, and even trying to add some of the underlying mechanisms to C++ (such as what they call "trivially relocatable types", or "destructing moves") has been quite difficult.


Actually, we already discussed Rust move semantics on this website some time ago: https://news.ycombinator.com/item?id=43059293

And again, the best way to explain this is by comparison to C++




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

Search: