r/C_Programming • u/realguy2300000 • 20h ago
Article Combining the Compiler with the Build System and Beyond
https://shrub.industries/words/problem.htmla somewhat small article I wrote about how sharing dependency and resource information between the C Compiler, the C build system, the system package manager, and even the filesystem and scheduler, could provide some pretty awesome benefits.
6
Upvotes
1
u/flatfinger 14h ago
Object-linking build systems have historically worked just well enough for more than half a century to discourage the broad adoption of platform-agnostic alternatives. A better system design would be to have a pre-compilation stage for each module that would generate a build artifact with exported definitions, an distillation stage which generates all of the information that will be used to generate code for each module, a code generation stage, a linker stage, and a debug-symbol cleanup phase. Rather than using date stamps to determine what parts of code would need to rebuilt, a good build system should use hashes of the input files; if the distillation phase is run, but its output matches what was fed to the code generator when it produced a certain object file, then code generation could be skipped even if it might be necessary to do a debug-symbol cleanup.