Hair-pulling, D, and Optlink

Sean Kelly sean at f4.ca
Fri Apr 21 12:43:36 PDT 2006


Walter Bright wrote:
> Lars Ivar Igesund wrote:
>> kris wrote:
>>
>>> This problem is not limited to OMF files -- it shows up on linux too,
>>> where ELF format is used.
>>>
>>> Sean asked why this issue does not crop up with DMC, or other C++
>>> compilers supporting templates? I'd like to understand that too. Would
>>> be nice if this (serious) difficulty were to get some lovin'
>>
>> Note that this has been reported before:
>>
>> http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D.bugs/5951
>>
>> Walter promised to check out it, but I haven't noticed any replies. 
>> Sitting
>> around #D, I've gotten the impression that Mr Chancellor and others
>> consider D's templates to be thouroughly broken due to these issues.
> 
> It "works" in C++ because the compiler regenerates the template 
> instantiation in *every* object file where it is used. The C++ compiler 
> doesn't know about other object files.
> 
> In D, when multiple sources are given on the command line, the compiler 
> doesn't generate redundant template instantiations.

But Ares is built one object at a time via a makefile, so there are no 
"multiple sources given on the command line."  Did you mean, perhaps, 
that this is somehow related to how DMD treats modules vs. how DMC 
treats source files?  ie. that the #include model effectively 
copy/pastes code while importing modules does not?


Sean



More information about the Digitalmars-d mailing list