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:
- C preprocessor
- Compile enough to figure out the types
- Expand templates
- Linker post-processing to remove templates of the same type occurring in multiple modules
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.