Comment by petcat

6 hours ago

At this point, is anybody writing new C or C++? It seems like they are sunset languages even at the big corps.

I'm pretty sure most big software projects (Windows, Linux, Chrome, gcc, LLVM, AAA game engines, ...) are still writing a lot of new C and C++. Pretty much everyone in the embedded world is as well.

As a solo programmer, I still prefer C and C++. In fact, as I've incorporated LLMs in to my workflow, I've been increasingly drawn toward C and its simplicity. A lot of the QoL features of C++ simply aren't needed when you're writing less code manually.

  • Using LLMs to write C feels a little silly to me. (Unless you really need C.) LLMs are still imperfect; you're still going to get a lot of UB bugs like human-authored C.

  • Chrome should be ported to Rust long ago. on Windows, half of the UI can migrate tomorrow with ease.

    • With the ram shortage they could start by removing all the web-views that should have been native

Far from it. Until Rust can read C++ code seamlessly, there will be more code written in C++ than Rust for the foreseeable future. HPC, Finance, AI, Games, Databases, Hardware all continue to be written in C++.

  • Serious people in all of those industries are thinking about whether and how Rust is a fit for their needs.

    Like, I agree that C++ will be around for a long while, but the writing is on the wall.

    • Strange position in 2026. If there is any writing in the wall it is this. Nobody is going to be writing Rust code from scratch given where LLMs are already now, much less in 5 years. A golden rule of software is fresh coding is a small part of the lifecycle most of it is maintenance. You may be able to get people to write Rust code (vibe code it), however a tiny minority of them will want to maintain LLM generated Rust code!! Rust will most likely be an intermediate representation - a security/formality check of sort - before converted into the appropriate heterogenous code across GPU/CPU/TPU/XPUs. Even there some other better representation will supplant it as Rust's ideas will be found too limiting. The idea that you as a programmer will sit and write Rust source code is just going to look very archaic. Thank god for LLMs for saving everyone just in time.

    • I agree momentum for Rust is growing, but disagree that it is obvious the writing is on the wall for C++. Like, Java and C# didn't kill C++, either. In all likelihood, these languages will all coexist for a long, long time.

    • For game development its hard to see how Rust can really replace C++ in practice. It'll take 15 years at minimum to replace the current development ecosystem for building games

      1 reply →

Unfortunately for me, yes. Some companies are very risk adverse and would rather stick with the devil they know. They have no idea what they are sacrificing.

Today I went over a TODO comment from 2007 in a C++ codebase that is still evolving very vividly, year after year. Trust me, for well established projects C++ is there to stay.

Games, anything that depends on LLVM, GCC, CUDA, SYSCL,....

Ah and Rust's compiler backend dependency on LLVM and in the future GCC as well.

C++ seems alive and well in the defense space. The big contractors near me have tons of C++ job postings and I don't think I've seen a single one looking for Rust.

  • The new drone companies seem to favor Rust more. Helsing sponsors a lot of Rust conferences and stuff. Quantum Systems has job postings for embedded Rust. For companies that don't have a lot of legacy influencing their decisions, Rust is pretty much always going to be in their software stack. The big primes will probably come around to it in a decade or so.

  • Do you know if the code bases are of the kind where dynamic memory (among many other features) is disallowed?

    • Defense industry can work around that.

        This sparked an interesting memory for me.  I was once working with a customer who was producing on-board software for a missile.  In my analysis of the code, I pointed out that they had a number of problems with storage leaks.  Imagine my surprise when the customers chief software engineer said "Of course it leaks".  He went on to point out that they had calculated the amount of memory the application would leak in the total possible flight time for the missile and then doubled that number.  They added this much additional memory to the hardware to "support" the leaks.  Since the missile will explode when it hits its target or at the end of its flight, the ultimate in garbage collection is performed without programmer intervention.
      

      https://devblogs.microsoft.com/oldnewthing/20180228-00/?p=98...

    • Some of them, probably.

      From the job postings, many of them seem to be physics simulations of various kinds where (in my experience) memory is allocated on the heap without a second thought. Well, there are second thoughts, but those second thoughts are about performance.

  • C++ requires defensive programming, so I guess it fits that defense requires C++ programming.

Yes mine is, because they have a huge amount of C++ already and none of it is publicly accessible so security isn't a concern. (Obviously there are many other reasons to prefer Rust, but that is a big one.)

grownups with important jobs write C

  • Are you just being snarky, or do you have something more specific to say about something that's choosing C?

    Considering that it's been 54 years, and we've yet to find any human being, any at all[1], who can write C without UB, I'd say that writing C in 2026 when there's any other option is basically misconduct and a good case could be made that if the code touches money in any way, then it could be a SOX violation too.

    Writing C today is like still writing Cobol. Yes, if you are adding a new type of savings account to your bank, and the rest is in Cobol, then sure write it in Cobol.

    Some microcontroller projects may have an ecosystem in C that makes other options harder in practice, but it's still a worthy investment to not use C. There's a reason phone baseband firmwares are moving away from C.

    [1] No, not even djb, who people like to bring up.

    • > Considering that it's been 54 years, and we've yet to find any human being, any at all[1], who can write C without UB

      Undefined behavior does not mean that a language is useless. C is quite nice to write as an abstraction over assembly, and I highly recommend writing C code and thinking about (and checking) what assembly it compiles into.

      Also, it is possible to verify that the types of UB that you are referring to do not occur: see the seL4 project, which provides machine-checked proofs for an OS kernel that no execution can reach a state that is undefined by the language specification.

      1 reply →

    • > Are you just being snarky,

      They aren't being snarky, they're stating a fact. Rust, rounding to the nearest percent, does not exist. It's a trendy language among the Silicon Valley types that HN draws, but 99.9% of the world runs on C/++, OSes written in C/++, and language VMs implemented in C/++. Maybe some day it will change, but hanging around here too much will give you a very skewed idea of how widely adopted it is.

      14 replies →

Cloudflare is all in on Rust, it's used everywhere by default, and C++ leftovers are being actively torn down.