Hacker News new | ask | show | jobs
by StillBored 2108 days ago
I've assumed that rust is going to be killed by a "-enforce-no-mutate-single-owner" or similar flag to gcc (or some linter) that restricts C++ code to some subset/style that nails the majority of what rust brings to the table. IMHO, like many other language paradigms, once you understand the core tenents of rust you could write "rust code" in many other languages. The difference being that those other languages don't _yet_ have flags/etc to enforce a rust like style.
2 comments

I wouldn't bet on it. Firstly, rust has value as a "C++ without the cruft" language even without safety as a USP, and secondly rust had to do a huge amount of design work to get the language to work in a way such that the kind of static analysis it does is reasonbaly feasible. C++ would need to adopt more paradigms and then create a subset of itself in order for this to work (there are such designs in the works like 'C++ Core', but they have already had to give up achieving the same level of safety as Rust gives).
Actually they do, it just happens to be WIP on clang and MSVC++.

CppCon 2019: “Lifetime analysis for everyone”

https://www.youtube.com/watch?v=d67kfSnhbpA