[OT] Clang seems to implement modules

Michel Fortin michel.fortin at michelf.ca
Mon Nov 19 18:11:16 PST 2012


On 2012-11-19 20:43:22 +0000, Walter Bright <newshound2 at digitalmars.com> said:

> On 11/17/2012 3:30 AM, bearophile wrote:
>> http://llvm.org/devmtg/2012-11/Gregor-Modules.pdf
> 
> One thing to note what it doesn't do - it doesn't produce a "module" 
> scope. As far as I can tell, the symbols in imported modules all go 
> into the global scope.
> 
> It seems to be mainly a way of legitimizing precompiled headers.

It's better semantically than precompiled headers because you're 
importing symbols only from the modules you import, not those from 
modules imported indirectly. Just that would be an incredible cleanup.

It seems there are actually two models: you can make modules from 
existing headers (by writing module maps), or you can create modules 
directly by starting your .c/.cpp file with "export <module name>;" as 
can see on the Writing a Module slide. The former approach is 
introduced as the transitional model, the later as the futuristic one 
that requires no headers.

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca/



More information about the Digitalmars-d-announce mailing list