Hacker News new | ask | show | jobs
by Hello71 3620 days ago
So hold on. Assuming that I understand C++ linking right, you're saying that I should include this 17000-line file in every single cpp unit in my application that uses Vulkan APIs? And people wonder why C++ programs compile so slowly.
2 comments

You may understand the mechanics of C++ linking (although I doubt it because including a header has nothing to do with linkage, I'm assuming you mean ADL, overload resolution, etc), but it doesn't seem you understand the mechanics of how C++ compilers are built and optimized. Furthermore, how many cpp units do you expect to require the Vulkan API? If it's much more than a few dozen, I would argue you haven't organized your engine well. Source: former graphics engineer.
>And people wonder why C++ programs compile so slowly.

People have been aware of this problem for some time. It's one of the reasons the C++ community is trying to develop a proper module system (or was the last time I checked, which was a while back).

By the time C++ has a working module system it will be as relevant as Fortran is now.
There's an experimental module system already in Visual C++, and I think in clang as well. It will be in the 2019 standard at the very latest.

I like Rust and all, but C++ isn't going away in the next three years.