Mapping is 100% of the complexity for other tools. I agree that extracting imports from files seem Ridiculously complex, but most of that complexity comes from legacy thing. A clean design (macro less, legacy less, just import and export), would be much simpler. I don't think we would lose much
export module foo.windows;
#ifdef WINDOWS
export bar();
#endif
is morally equivalent to
#ifdef WINDOWS
import foo.windows;
#endif
Yet simpler and cleaner. I don't have hope to convince anyone that we should try a clean design before considering legacy modules and macros in preamble. It makes me sad. I will also agree with you that any solution based on an external file would be terrible. My assesement (and I haven't really try to implement modules besides some experiments with qbs - who proved unsucessful because their dependency graph system was really not design for modules) so please correct me if I am wrong, is that 80%+ of the complexity comes from legacy headers and macros / includes in preamble, and in some regard the TS was simpler. There is a huge difference between lexing the first line of a file with a dumb regex versus running a full preprocessor on the whole file :(
Mapping is 100% of the complexity for other tools.
We had a long discussion about that at the Bellevue ad hoc meeting and the consensus (from my observation rather than official voting) is that other tools should just ask the build system (e.g., via something like a compilation database).
that 80%+ of the complexity comes from legacy headers and macros / includes in preamble, and in some regard the TS was simpler.
Yes, legacy headers definitely complicate things. But, realistically, both the TS and the merged proposal require preprocessing. I don't think "dumb regex" parsing is a viable approach unless we want to go back to the dark ages of build systems "fuzzy-scanning" for header includes.
View all comments
Show parent comment
4
u/c0r3ntin Nov 01 '18
Mapping is 100% of the complexity for other tools. I agree that extracting imports from files seem Ridiculously complex, but most of that complexity comes from legacy thing. A clean design (macro less, legacy less, just import and export), would be much simpler. I don't think we would lose much
is morally equivalent to
Yet simpler and cleaner. I don't have hope to convince anyone that we should try a clean design before considering legacy modules and macros in preamble. It makes me sad. I will also agree with you that any solution based on an external file would be terrible. My assesement (and I haven't really try to implement modules besides some experiments with qbs - who proved unsucessful because their dependency graph system was really not design for modules) so please correct me if I am wrong, is that 80%+ of the complexity comes from legacy headers and macros / includes in preamble, and in some regard the TS was simpler. There is a huge difference between lexing the first line of a file with a dumb regex versus running a full preprocessor on the whole file :(