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

I wish C++ compilers written in C++ were blazing fast too.


They are. They've just chosen to spend all their speed gains on more optimization passes and static analysis, to produce ever faster outputs than to produce an output faster.


Their fundamental model is one translation unit per time, while developers decided that writing all library code in headers is a good idea. Which makes them parse and DCE literally kilometers of mostly irrelevant code again and again. You’re not wrong, but it’s not the complete point. C++ development is slow as a whole, and compilers/standards do nothing to fix that. It’s a kind of F1 engine in a tractor situation.


> while developers decided that writing all library code in headers is a good idea.

It wasn't developers who designed C++'s template model which requires generic code to be fully defined in header files.

Inheriting C's textual include file based "module" system and then bolting compile-time specialized generics is a choice the C++ committee made, not C++ users. It was probably the right choice given C++'s many very difficult constraints, but that's what directly leads to huge compile times, not dumb C++ users.


> and compilers/standards do nothing to fix that

C++20 finally standardized modules. Whether they will improve things significantly is still anyone guess.




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

Search: