Live data from Hacker News

C++ creator rebuts White House warning

infoworld.com

91–100 of 141 posts

Re: C++ creator rebuts White House warning

#91
post #9

Earlier quoted context omitted.

I think the funny thing is you no longer even get peak performance from C++. In many ways Java is running rings around C++ performance. Partly, it's because you get state-of-the-art peak optimizations for free from Java, and you'll need a team of 20 full-time build engineers to get a peak C++ artifact with PGO, LTO, and post-link optimizations. Partly it's because the speed of C++ is illusory, with the superficial su…

I acknowledge C++'s safety concerns, but no, Java is definitely NOT running rings around C++ perf. Not a single AI/ML model is implemented in Java. The core of AI/ML runs on C++ only. You may see a lot of Python, but the core engine that Python is wrapping is written in C++. Sorry to break it to you but Java cannot even come close here.

The reason for that mostly is CUDA only supports C and C++ natively.

Re: C++ creator rebuts White House warning

#92
post #8

Yeah. The language you pick doesn't magically make you Fort Knox regardless of "memory safety". Rewind in time and the White House would be berating all of us to write in Java... you know... a "memory safe" language, only for the worst security fail to come along Log4Shell.

Yeah the logging bug was bad. That’s one bad bug. C++ has bugs that bad that are found and weaponized daily. So, Java is much safer probably by 2-3 orders of magnitude. Also - the log4j thing shows just how dangerous class loading is. It’s an eval like mechanism. Probably future languages designed with safety in mind should avoid eval-like mechanisms as well as avoiding type system escape hatches.

Ha! Like C & C++ coders haven't been sending and receiving structs as byte streams over networks. Less common today to be sure, but that was a VERY common practice that obviously led to a lot of CVEs. C coders before the internet went public, working on Novell Netware networks were slinging structs willy-nilly over their token ring and thin net, let me tell you!

Re: C++ creator rebuts White House warning

#93

Earlier quoted context omitted.

> The first step to solving a problem is accepting reality. Ok, the first thing I’d like to accept is that C++ is just not safe enough for most applications. And yes—you also can’t throw C++ in the garbage. Both of those statement are part of our reality—C++ is unsafe, and we will use it anyway. That’s why we solve this problem on two fronts. First, we advise programmers to ditch C++ for safer languages, when reasona…

I've yet to see a valid scenario where C++ is superior to Rust, Python and Go. Use Python. If you need concurrency, then use Go. If you need even more performance, use Rust (using unsafe Rust only for the parts that need it). For the highest performance stuff, maybe consider C for critical parts only. C++ is not safe. It's a minefield of things that compile but are memory management mistakes. And then you're like "Lo…

Don't use Python. You will produce unmaintainable code that will have to be thrown away in 5 years because it is impossible to refactor.

Re: C++ creator rebuts White House warning

#95
post #51

What makes me wary of jumping to Rust is the async stuff. From what I read, colored functions were introduced and most of the libraries that do useful stuff adopted async and kind of force you to be aware of it in your own code. For me, the perfect C++ replacement would be something like Go without the runtime burden. I'm not sure that this exists, so I use Go whenever I can and C++ in the ultra rare cases where I ca…

If you want to call an async function from a sync context, use `futures::executor::block_on`. Nobody is forcing you to use async.

Re: C++ creator rebuts White House warning

#97

The amount of iconoclastic knee jerking in this thread is kinda nuts. Equating this rebuttal to an old man yelling at clouds? Saying Cpp never made sense? The first step to solving a problem is accepting reality. Cpp has been foundational, like C, to our computing world. If the rich legacy of libraries that underpin our "better" language choices is offensive to us, or if we really believe we are powerless to improve…

yes!

and a core part of getting this right is the maturity of other features, like generics/templates, duck typing instead of or in addition to inheritance, portable and well defined data memory layout, ease of reuse of existing mature C++ libraries (think numerical Fortran). I consider a language defined module system, straightforward parsing and higher level concurrency (like channels) almost icing on the cake...

nobody is served with a forced rush from one idiosyncratic complexity to another.

and imnsho the core issue with C++ is _not_ "safety" but complexity, of the language as such. it's just way to easy to write leaky or out of bounds writing code, in C and still in C++.

and in that vein I really love carbon and Herb Sutter's Work and get me right, also rust and even good old Ada got a lot right.

but please, can we discuss the better, next gen systems language as if it were not religions? but technology choices with ups and downs?

Re: C++ creator rebuts White House warning

#98

> Of the billions of lines of C++, few completely follow modern guidelines, and peoples’ notions of which aspects of safety are important differ. The fundamental problem is they’re just guidelines and they’ll always be just guidelines. You can still do all the wild old stuff without so much as a warning and you’ll have to figure out how it even interacts with the new stuff which exposes yet another vector for failure…

linters nudge about not following guidelines, and project policies turn the Judges into enforcement.

Re: C++ creator rebuts White House warning

#99
Table saw manufacturers wonder why Exacto knife users are so worried about their fingers getting cut off. The simple and obvious explanation is we now live in a world where many people are too lazy and/or dumb to spend time learning the tools of their trade.

3..2..1

Re: C++ creator rebuts White House warning

#100

So what it sounds like: Strousoup: The future is a yet to be defined profiles. Sutter: The future is a yet to be defined C++v2 that's backwards compatible but also solves the problems. Chandler: C++ compile times are too slow. Going to build a brand new front-end that really fixes compile performance and maybe fixes memory safety & let's you call C++ code. My take: Re Strousoup: From what I've seen, Strousoup's ideas…

hooray! a down to earth stay with the facts response! thank you for that. if I'm not mistaken, Chandler and Sutter lead efforts to untangle what we have, sucht that we can then improve upon it, with better templates/metaprogramming or borrow annotations or bounds checking containers etc.

for C++ especially it's really two things that make it hard: it's idiosyncracies (that's what they work on) and then in addition the lack of these new abilities.

Post reply on HN