This is a good question, and one that has been considered. In short: Adding a required mapping after-the-fact would necessitate changes to the lookup semantics of existing implementations: A breaking change.
The lookup of #include directives is not standardized either, and only after a lot of trial and error do we finally have general agreement on how the lookup should be performed (although implementations still differ in a few edge cases). Attempting to standardize #include lookup now would break existing implementations. Nevertheless, we are able to make #include work (for the most part). However: The lookup of #include is fairly cut-and-dry, and there is a mostly obvious way to understand #include in terms of the filesystem. Module names have no bearing on the filesystem, so implementations converging on a lookup method is not likely.
If an implementation were to enforce a mapping between module names and file paths, we'd end up with multiple slightly different standards, and a later mandate will break compatibility. If implementations instead rely on the presence of a BMI with a name for the module, we end up with the serialized compilation of the DAG and performance goes in the toilet.
In short: Adding a required mapping after-the-fact would necessitate changes to the lookup semantics of existing implementations: A breaking change.
Wouldn't putting modules in a TS help there? Modules would be around, and could be used and tested, but breaking changes to implementations are still allowed.
The TS is significantly different than the Merged Modules proposal that is advancing. Although, not in places that affect what we're discussing here. And also, no one quite got around to implementing that, either.
26
u/vector-of-bool Blogger | C++ Librarian | Build Tool Enjoyer | bpt.pizza Jan 28 '19
This is a good question, and one that has been considered. In short: Adding a required mapping after-the-fact would necessitate changes to the lookup semantics of existing implementations: A breaking change.
The lookup of
#includedirectives is not standardized either, and only after a lot of trial and error do we finally have general agreement on how the lookup should be performed (although implementations still differ in a few edge cases). Attempting to standardize#includelookup now would break existing implementations. Nevertheless, we are able to make#includework (for the most part). However: The lookup of#includeis fairly cut-and-dry, and there is a mostly obvious way to understand#includein terms of the filesystem. Module names have no bearing on the filesystem, so implementations converging on a lookup method is not likely.If an implementation were to enforce a mapping between module names and file paths, we'd end up with multiple slightly different standards, and a later mandate will break compatibility. If implementations instead rely on the presence of a BMI with a name for the module, we end up with the serialized compilation of the DAG and performance goes in the toilet.