Log in

Sat, Nov. 14th, 2009, 02:19 pm

Why C++ continues to take forever to compile even on machines many orders of magnitude faster than the first ones I ever used it on has long been a mystery to me. I hope the answer is simply that it's a language which wasn't designed with ease of parsing in mind, and has a whole layer of preprocessing on top of it which is horribly abused.

As I understand, C++ requires something like this:
  1. C preprocessor
  2. Compile enough to figure out the types
  3. Expand templates
  4. Compile
  5. Assemble
  6. Linker post-processing to remove templates of the same type occurring in multiple modules
  7. Link
I imagine very modern C++ compilers have managed to find hacks to combine some of these steps somehow, but there's only so much they can do.

The first C++ compiler compiled to C.

No HTML allowed in subject


Notice! This user has turned on the option that logs IP addresses of anonymous posters. 

(will be screened)