Conversation

IMO the Chrome article on why borrow checking is impossible in C++ largely misses the point. The biggest issue is simply that virtually no C++ code is written under the invariants that the borrow check enforces, so C++-plus-borrow-check loses compatibility with existing C++.
7
231
Replying to
I agree. But my read of the article is it was to serve as a technical rebuttal for people saying “but C++ can do this too.” As written, it is rather effective at preventing C++ stalwarts from pushing an invalid argument!
2
30
Replying to and
If you say “you need to change how you write C++,” people will say “then we’ll change how we write C++.” But if you say “you can’t do this if you tried: here’s the proof/code” it cuts off the debate.
1
21
Replying to
Well, I feel like if you modified the language a LOT you could do something that resembles "add borrow checking to C++". But that's my point: such a modification of C++ will by definition have the same restrictions as Rust, including that you can't make mutable shared_ptr.
2
22
Replying to and
I think most of their engineers have already come to that conclusion a long time ago, but they need to make the case that C++ is a dead end and then to specifically adopt Rust as the solution. They're not going to invest millions of dollars into it without lots of research.
1
3
ChromeOS and Fuchsia have been using Rust in certain areas already. Chrome hasn't started using it outside of ChromeOS though. Each of these is essentially a separate sub-organization within Google and makes their own decisions about languages. Each has pretty much rejected Go.
1
4
As far as I know, Google isn't using much Rust outside these 3 sub-organizations. I expect they're replacing a lot of their C++ and Java elsewhere with Go, although they're still likely to start using both Rust and Kotlin as replacements for those. It's a huge decision to make.
1
3
Show replies