top | item 42004492

Rust and C++ with Steve Klabnik and Herb Sutter [audio]

70 points| mcqueenjordan | 1 year ago |softwareengineeringdaily.com

55 comments

order

tialaramex|1 year ago

Steve is too modest about the tests by the way. Lots of the conformance testing for Rust's compiler happens automatically. Herb mentions Perennial https://www.peren.com/ and Plum Hall https://plumhall.com/ for C++ and Steve says "I'm not saying that functions as a conformance test suite" when it comes to Rust's own compiler tests. But, while the Rust project itself does not perform conformance testing, Ferrous Systems does and so yeah, analogous conformance test suites exist and are run automatically.

So when Herb says "And in Rust's case, that's going to need to be built out" if the interview was taking place five years ago that's an important point. But it wasn't five years ago, it was only a few weeks ago.

bregma|1 year ago

> analogous conformance test suites exist and are run automatically

I'm not clear on how this is even possible. "Conformance" for C++ means adherence to the published ISO/IEC 14882 standard. In the case of Rust, it's "this is what the compiler does this week". Sure, a third party has built out a CI system for Rust and uses it provide evidence that Rust does what Rust does, but that's nothing similar to having evidence any random toolchain conforms to an accepted, published, international standard of what the C++ language does.

When it comes to providing test evidence for functional safety (for example ISO 26262 or IEC 61508) I can point to Perennial or Sold Sands results and say with confidence that my toolchain does what it says on the C++ box. When it comes to Rust, I can point to Ferrous and say "the core Rust language when built using rustc does what the rustc developers claimed it should do last week, excluding any crates or libraries." To which claim are you going to trust the lives of you and your loved ones?

They aren't analogous at all. There is just reams of marketing spin here and eventually it's going to kill someone.

myworkinisgood|1 year ago

C++ leadership are blinded by their own success and have no information of outside world.

mcqueenjordan|1 year ago

tialaramex|1 year ago

Note that although this is a really good transcript (remember that awful auto-generated transcript for an interview (podcast maybe? I don't recall all the details) with tptacek way back? Not like that) it isn't actually written by a Rust or C++ programmer (or if it was they aren't paying attention) so e.g. it says "mute" because that's how you pronounce the keyword "mut" in Rust, just as C++ people often pronounce their "char" keyword "car".

joaquincabezas|1 year ago

I've been a long time considering that I should learn Rust. I am using Python as main language (for Machine Learning tasks) so I am at the edge:

Go with:

C++, because I used to code in C (for embedded, 8-bit microcontrollers) when I was younger and also for its possible advantage for learning some CUDA (this last thing is mostly for fun)

or

Rust, because I have some trauma for kernel panics with bad memory management back in the days with C, and because I want to build some tooling in a nice, efficient way

creata|1 year ago

Learn both. Rust first, because it's a lot more approachable. Modern C++ doesn't really have much in common with C to be honest.

Also, you'd probably have found these quickly, but cppreference.com is the nicest C++ reference (!cppref on DuckDuckGo) and doc.rust-lang.org (!rust on DuckDuckGo) has the Rust standard library documentation.

jb1991|1 year ago

Coding in C++ is very different than it is for C and you should not consider them similar in any way. They are now two very different languages and nearly all the idioms in common use in C are considered bad practice in C++. It has been many years since these two languages could be considered similar.

JTyQZSnP3cQGa8B|1 year ago

IMHO Rust is between C and C++: more secure and powerful than C, simpler than C++, but it has the potential to do everything.

If you already know C and Python, it would be a better and faster choice. I’m more a C++ expert, but I’ve written a few small command line tools in Rust and it looked a bit like the Python equivalents.

pryelluw|1 year ago

If you would have just learned it in the time you’ve spent considering learning it then you would not need to decide. Go download the rust book or lessons in the terminal. They’re great resources.

randomNumber7|1 year ago

Imo C++ only makes sense if you commit enough time. If you are not planning to work with it as an expert I would look somewhere else.

I dont want to comment about rust, but personally I just don't like ideological people. Also some people seem to not understand, that the set of all valid computer programs is greater than the set of all programs that can be proved correct. It is a fact and can be proven.

Imo C# is a well designed language and would be the best start to learn more about a modern statically typed language. Swift is also interesting, but its mostly apple and has similiar ideologic problems like rust (e.g. pointers are evil).

on_the_train|1 year ago

If Rust would stop the politics pushing, I wouldn't be so afraid of it

singularity2001|1 year ago

IF you learn C++ I'd suggest to use it as a nicer C, without any std:: or the million other complications. Write your own List / String classes for fun, they can't be much worse than the std ones.

diimdeep|1 year ago

Be aware that this is Microsoft/FAANG camp echo chamberly discussion lacking self criticism, very shallow and "safe" (pun intended) chain of though that sums up to basically here we are maintaining stuff for Microsoft, only mentioning c++ and rust, C# and Carbon.

In similar vein, just so happens that yesterday I listened to discussion to folks outside of bigtech camp and it was much more insightful and introspective, although it is with creator of Zig and Odin language themselves instead of mere evangelists and methodologist book sellers. "Boundaries of Language Design" with Andrew Kelley & Ginger Bill [1] https://www.youtube.com/watch?v=3K8znjWN_Ig

nicce|1 year ago

> with creator of Zig and Odin language themselves instead of mere evangelists and methodologist book sellers.

To be fair, creators are the Jesus Christ in the context of evangelists. There is a strong belief why they created the language.

lifthrasiir|1 year ago

Not necessarily because they are in an echo chamber, but both languages are much younger than C++, C# and Rust. (I don't think Carbon even has a significant footprint to be mentioned by now.) I appreciate both languages but they have much long road to go, including the initial "production" version which Rust reached a decade ago.

wild_pointer|1 year ago

Expected a safety fight. The talk didn't deliver :(

steveklabnik|1 year ago

I don’t want to have a fight, but this was recorded a few weeks before the safety thing became a big issue in the C++ world again, so that’s why it didn’t come up.

shikaan|1 year ago

I feel this podcast was the first time Rust was sold to me in a way I would buy it, and it was done by the C++ party of this conversation

sylware|1 year ago

[deleted]

ost-ing|1 year ago

Rust isn't complex, low level and systems level concepts are complicated. Rust does a fantastic job at exposing you to the lower level with a very articulate syntax and philosophy of how to handle things in a fast and safe way.

faglog|1 year ago

> Ofc, the guy pushing rust in the kernel was from msft... obvious flashing red sign.

Rust is already in the Windows kernel for the code behind some syscalls, and there's a kernel driver framework for Rust. It's proven work that's already shipped to hundreds of millions of devices.

Not sure what you're complaining about tbh.

cjfd|1 year ago

I think C++ and Rust are just fine. What you call verbosity is actually essential information that some other languages are missing and by doing so, force terrible inefficiency upon the user.

nasso_dev|1 year ago

have you considered that perhaps you're not the target? perhaps your problems are just better solved with different languages and that's okay?

high_na_euv|1 year ago

>Ofc, the guy pushing rust in the kernel was from msft... obvious flashing red sign.

How?

Just dont reply with EEE

pyrale|1 year ago

> I am sorry, but this is propaganda: rust and c++ are the same evil: computer languages with an obscene syntax complexity.

All computer languages are bad, but not all are bad equally, or for the same reasons. That's a fine point you're making.

OtomotO|1 year ago

I am sorry, but your comment is propaganda too :)

randomNumber7|1 year ago

Maybe you are just not intelligent enough to understand it.