logoalt Hacker News

Eji1700 • today at 10:07 AM • 4 replies • view on HN

> C++ still owns bare metal, low-latency trading, game engines, GPU inference kernels, and decade-spanning binary ABI stability

I wonder how long many of these will last.

AI is absolutely a predator to C++ not a benefit as the author notes, at least in my untrained eyes. Any language that gives you consistent “pythonic” standards and compile time “if it compiles it runs” guarantees (or tries to) seems to perform VASTLY better with AI than the ones that can’t.

C++ has, as an outsider who’s talked to C/C++ coders and written less than 1000 lines, felt like it decided “yeah but if you want fast on bare metal you’ll put up with it” and left it there.

Rust was designed to come for that lunch and it sure seems like that time is upon us. I’ve no doubt that the most performant code may still be theirs, but if it’s not on a rocket it’s probably going to be Rust not C++ sooner than later.

With that in mind I’m extremely curious how much longer it’ll be the standard for games. Yes if you want cutting edge graphics and physics you’re going to be managing your memory and might as well go deep, but as more and more of my backlog looks like Probably Stolen or say more “demanding” Caves of Qud or Nuclear Option i wonder where that line starts to blur.

Given the whole “shipping” goal I don’t see the next generation reaching for something so “hostile” when good enough and easy to work with get the job done and don’t have “must trade every nano second” needs


Replies

r_lee • today at 10:33 AM

I think C++ very likely might still be the choice for GPU stuff or trading or any kind of number crunching, maybe also game engines

but it really doesn't matter since it's such a niche area. Rust doesn't need to take these over, there's really no any need to

but the vast majority of old C++ was simply general purpose stuff like web servers/backends/databases etc. and now it's more of a liability to use it, especially for a backend with untrusted clients interacting with it

for games, probably it'll be hidden behind FFI, like a lot of it already is like in the ML space

➕ show 1 reply
DrBazza • today at 10:30 AM

For low latency trading, C++ templates and constexpr are the significant unique selling points. If Rust gets at least equivalent or better functionality, then there's not much reason to continue using C++. Other opinions may differ.

pjmlp • today at 10:34 AM

Rust still has the issue that its reference compilers depend on C++ tooling.

Until it is fully bootstraped, it can't fully replace it.

Note that LLVM and GCC are the few projects that have a similar level of contributions as the Linux kernel.

➕ show 1 reply
worried_individ • today at 10:44 AM

what AI literally does is make unobservable language/code level differences between languages irrelevant.

compile times, code/codebase size, and obviously the observables in the final product (memory usage and runtime performance, security) will matter. but the actual code is next to irrelevant, assuming that AI can work with any language at about the same level.

rust still loses on all of these except security. it doesnt matter if in practice rust only loses by 0.5% on perf because the core libraries everyone uses just aren't optimized enough - as long as that changes, certain applications (e.g. those that dont care about the built in compile time security and are happy to fix it up in cpp with AI loops), those projects wont switch to rust.

compile times are especially horrendous btw. hard to think someone came up with a language that takes even longer to compile and iterate on than cpp .