3 ms·
>If one would only use modules these errors would simply not exist. In exchange for reducing parallelism because you are not using forward declerations to brea
by charcircuit 3y ago
>If one would only use modules these errors would simply not exist.
In exchange for reducing parallelism because you are not using forward declerations to break dependency chains up.
- silon42 3y ago+1 I once refactored part of my code for headers to only #include forward declarations (and few generics, of course), except where really needed (implementation) It made compile times 2x faster, probably could get 3x if fully done.
- gpderetta 3y agoIt is going to be a struggle. Headers work well for full recompilation as they provide significant parallelism. But are very bad for incremental compilation.
- pjmlp 3y agoOnly for the mindset stuck in the classical UNIX tooling approach, module based languages have used parallel compilation for a long time. The big difference is that those communities embrace compiler and tooling are part of the same story. Thankfully now we have a tools working group trying to bring C++ community into the modern world of module based compiler toolchains.
- charcircuit 3y agoShow me a module based language that maintains the same parallelism of compiles.
- pjmlp 3y agoC#, compiling in parallel since the C++ compiler was replaced with a C# written one, beating C++ traditional compile times hands down. Go, compiling code in parallel since Go 1.19. One is able to compile the whole toolchain from scratch faster than many C++ codebases. Active Oberon, compiling in parallel via the Paco toolchain since 2003, a full graphical workstation OS, built in a couple of minutes. Ada, parallel compilation available in most toolchains since 1989. Also available in GNAT. Delphi, yet another example. It is C++ that needs to get up to date with modern toolchains and away from hacks like unity builds.
- neonsunset 3y agoGo compiler does incomparably less work than GCC. Arguably, GCC could have been faster, but this is somewhat apple to oranges comparison. The closer one possibly is comparing .NET Native AOT and GCC, where the compilation times and memory use start not to differ that much because of significant amount of work required to properly optimize and link all assemblies/compilation units. Otherwise, I agree that LLVM and GCC are not an end all and be all, and have significant issues with compilation performance.
- pjmlp 3y agoNotice how you ignored the existence of .NET Native, Ada, Delphi. While I can pick other examples, I can't be bothered providing an exaustive list of every single language with compiler toolchains doing parallel compilation.
- neonsunset 3y ago.NET Native is dead and when Ada or Delphi were in their prime I did not even have a computer which is why they got no mention :)