Future of C++ Modules

Hi,

I've been reading into the future of C++ modules, and I don't think they can come soon enough. However, if waiting means they can do a damn fine job implementing them, then I'm willing to wait (though unfortunately this doesn't seem to matter, as there doesn't seem to a whole lot of progress on modules at all). Anyway, I'm curious as to some of the ramifications modules might have on the language (for better or worse).

Circular dependencies:
I'd be fine with the header/source pattern if it weren't for the madness with circular dependencies and forward declarations and all that crap. It just makes code uglier, and often I feel I'm struggling more with the compiler itself than the design of what I'm creating. If modules have the same issue (module A has references to module B and vice-versa), then don't even bother. I'm no expert on compilers, but I don't see why they can't use some sort of lazy symbol resolution to allow for this kind of thing. Most modern languages do (and there's no reason why C++ can't be treated as a "modern" language).

Closed-source libraries:
Most closed-source libraries rely on just giving you the header files (hiding their implementation) and giving you a .lib/.dll to link with. Could modules break this?

Anyway, I had a few other concerns but I forgot them and I'm hungry. It disheartens me how modules don't seem to be a priority at the C++ committee, because if they really do a good job with them it could definitely rejuvenate the the language and the community. As the switch will likely have a huge impact on compilers anyway, they might as well take the changes as far as they can to make the language much more usable. They've done some fantastic work regarding code readability with 'auto' and 'for-each', but I'd trade those in a heartbeat for modules.

So if anyone has any insight into how this is going to be handled (and more importantly, when) please jump in below.

Thanks!
Last edited on
Modules can certainly be emulated with design patterns, but that doesn't come close to the ease of use and power that full compiler support can provide. I was thinking something more like this:
http://clang.llvm.org/docs/Modules.html
Last edited on
Topic archived. No new replies allowed.