Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The only thing keeping C around are FOSS UNIX clones and embedded developers that are religiously stuck with C89 and their PIC compiler extensions.

Even Arduino like boards use C++ nowadays.

Unity and Godot have their graphics engine written in C++.

Rust, Swift are dependent on LLVM, written in C++.

Go, it isn't really in the same league of programmer expressiveness.



The "only thing" (FOSS UNIX clones) is kind of a gigantic thing.

The Windows kernel is mostly written in C, too. iOS uses Objective C.

Modern C++ isn't bad, but robust classes require an enormous effort together with tests suites that approach the size of test suites required for an untyped Python module.

In practice segfaults are as prevalent in C++ as they are in C. Type errors by implicit conversions are more frequent in C++ than they are in C. Full testing of all conversion rules requires a superhuman effort.

So I think well written C is often safer than well written C++, because one does not have to deal with the case explosions introduced by classes and their implicit rules.

The often quoted safer strings in C++ are just a very tiny part of the equation.

If I had my way, we'd all be writing Ada or Standard ML, but no one listens.


While they are still gigantic, I bet long term they will stop being so, thanks to the cloud, type 1 hypervisors, unikernels and serverless computing.

30 years ago no one though commercial UNIXes would be wiped out by a "toy" UNIX clone project.

Windows kernel has been moving into C compiled as C++ since Vista introduced support for kernel mode C++.

iOS uses C++ for its drivers, Metal shaders and compiler toolchain. That Objective-C implementation relies on C++.

Yes, the Trojan horse of C's copy-paste compatibility is also its Achilles heel of security, however in contrast with C's attitude regarding security, C++ provides the library types to actually implement secure code, if one bothers to make use of them.

If I had my way, C would have bounds checking enabled by default, strong typed enums, proper arrays and strings, but no one at WG14 listens.


There are lots of performance sensitive tools, language runtimes, and cross-platform libraries written in C.


And even more written in C++. Should we start counting which ones?


Hmm, I’m not sure I’d readily agree.


Starting by Clang and GCC, I bet that for most relevant C projects there is somehow an equivalent written in C++, or even more than one, with the exception of UNIX kernel clones.


Let's start with CPython. What is an equivalent written in C++? (Note: there is an equivalent written in both Java and C#. But not C++.)


I guess Numba might quality.

Then we have Pyston, and the ill fated unladen-swallow.


I have spend the quarantine hacking in C. On FreeCIV.

Still used lots and lots of places


Same can be said by any programming language, C is the Cobol of systems programming languages, so as long as there UNIX FOSS clones it won't go away.


Freeciv fan here. What are you working on in it?


Forked Attitude AI and making a rules based AI




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: