Reply to post: Is Bjarne Stroustrup Right?

Google polishes Chromium code with a layer of Rust

bazza Silver badge

Is Bjarne Stroustrup Right?

Genuine question - I don't know. Bjarne Stroustrup is a clever guy, I just need help absorbing the full meaning of what he's saying about modern C++.

I've had a look at the materials produced by Bjarne Stroustrup in saying that modern C++ can match Rust for memory safety.

I ask specifically about the exclusive mutability that Rust has. I'm not entirely clear from what Bjarne Stroustrup has emitted exactly how that is recreated in C++. Are we talking about unique_ptr? And does that completely match Rust's exclusive mutability?

From what I've read by Bjarne Stroustrup, it seems that he's basically saying that using some of the modern features of C++ and being disciplined (no cheating, use a linter, etc) and you can achieve the same end result.

For me, the advantage of Rust would be that provided the unsafe keyword didn't appear anywhere the code review burden is a lot lower. If one set up a C++ writing environment and checking toolset to enforce the same discipline and rigour, fine, but it sounds like making that flaw tight is tougher.

It could be quite interesting if there were a flavour of c++ compiler that applied Bjarne's prescriptions.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon