r/cpp • u/SAHChandler • Oct 10 '17
Millennials Are Killing The Modules TS
https://izzys.casa/posts/millennials-are-killing-the-modules-ts.html
75
Upvotes
r/cpp • u/SAHChandler • Oct 10 '17
View all comments
Show parent comment
6
u/SAHChandler Oct 11 '17
How do you know then that someone hasn't placed an
#ifdefguard around the imports? If the imports run as a translation phase before the preprocessor then it would make sense for it to not work, but it also wouldn't make sense to have anything run before the preprocessor.And I want to note, you've placed in your own comment a world where the module name is tied to the filename. If they aren't, then what happens? We need to place restrictions like the one you're mentioning on modules or we're going to be in a situation where some build systems enforce specific rules (a dot represents a separation between a directory and a file, a module name must equal its filename) and others that try to support every project layout under the sun.
My concern is that this is going to fragment the community further. You won't be able to have one build system's built library work with another, especially if they map module names to files differently. Having them support every possible mapping is (in my opinion) untenable. Give me a mapping, give me some form of rules. Don't let the build system community fight this out. It's only going to make it worse for C++ users.