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

"It's mostly C" isn't an argument, it's an empirical observation. There are various historical and technical (ABI issues mostly) reasons to use C for kernels, hypervisors, filesystems and drivers. I'd still use C++ for all of the above, although a restricted subset if I'm writing a kernel, hypervisor, or driver. I would only export a C interface from my C++ code if it requires dynamic linking though (e.g., I would never write a export a kernel's API for device drivers in C++)

I also don't mean learning minutiae for minutia's sake. Most of my work has been on compilers and servers, and I'd gladly take C++ for these tasks. Why should I do the extra footwork to write it in C?

A sibling post mentioned LLVM. This is a great case in point. You should look at the GCC source sometime... it's absolutely atrocious. LLVM is on the entire opposite end of things, the code and design are beautiful. Hacking on GCC requires 80 pounds of body armor and a consultation with the local shaman. Hacking on LLVM is fun, exciting, and easy.

"Reload is the GCC equivalent of Satan." http://gcc.gnu.org/wiki/reload

GCC's internal garbage collector. Yes, they really wrote a garbage collector for a C app, and dealing with it is just as pleasant as you'd imagine. http://gcc.gnu.org/wiki/Memory_management



There's definitely good C++ code; the MIT PDOS Click router (http://www.read.cs.ucla.edu/click/) is another great example. But there's good Perl too.

I'd definitely use LLVM before I hacked up GCC.




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

Search: