Not really, in C++ templates still need to be instantiated in every module but modules don't have to each repeat the parsing of template definitions. The module that declares the template will do the job of parsing the template and producing some intermediate representation of it that other modules can consume. Okay that does save some amount of time but the overwhelming majority of time spent compiling templates is in instantiating them, not parsing them from literal text into an AST.
Modules don't make instantiating templates any faster, it only makes parsing them faster.
Re:How generics are implemented in Go 1.18
by pjmlp on Wednesday March 02, 2022 @04:02AM
(#30525339)
They sure do, make the most common expansions avaiable as extern templates.
Re:How generics are implemented in Go 1.18
by Kranar on Wednesday March 02, 2022 @09:43AM
(#30527837)
That has nothing to do with modules. You can extern a template going back to C++11.
Re:How generics are implemented in Go 1.18
by pjmlp on Wednesday March 02, 2022 @11:03AM
(#30528810)
Modules make it more convinient to do so, and allow for more build speedups.
Yes, with VC++ offering the best experience currently.
Re:How generics are implemented in Go 1.18
by throwaway2037 on Wednesday March 02, 2022 @08:50PM
(#30536099)
I am confused. Why was this downvoted? Is GCC and Clang doing better? (Or another C++ compiler?)
Re:How generics are implemented in Go 1.18
by Kranar on Thursday March 03, 2022 @01:14PM
(#30544558)
Because the answer is false, modules do not solve the problem of having common/shared template instantiations.
As for the comment about MSVC, it's mostly off topic, doesn't relate to the question that was asked (which had nothing to do with which compiler provides the best experience), and even if you accept that MSVC provides the best module experience, it's support for it is still very buggy and not suitable for anything other than experimenting and beta testing.
[1] https://en.cppreference.com/w/cpp/language/modules