Proposed improvements to the separate compilation model

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Jul 22 19:52:12 PDT 2011


On 7/22/11 9:29 PM, Vladimir Panteleev wrote:
> On Sat, 23 Jul 2011 01:06:19 +0300, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> A chat in IRC revealed a couple of possible improvements to the
>> development scenario in which the interface file (.di) is managed
>> manually and separately from the implementation file (.d).
>
> I might be forgetting bits of our discussions at the moment, but has it
> been considered that instead of facilitating use of manually-maintained
> .di files, to instead improve auto-generated .di files to the point that
> manual maintenance is not necessary? Some ideas:
>
> 1) As discussed, @ctfeable (include function body in .di to allow using
> in CTFE)
> 2) Removing imports for modules containing symbols not mentioned in .di
> code (avoid pulling in dependencies of the implementation)
> 3) Perhaps, adding opaque objects ("class X;") to the language and
> emitting those as appropriate? (semi-automatic Pimpls)
>
> Did I miss anything?

I don't think it's an either-or situation. For a variety of reasons, 
some organizations want separate control of the "declaration" and 
"definition" files. Inability to do so is a common criticism leveled 
against Java and one of the reasons for the proliferation of XML 
configuration files and dynamic loading in that language.

Andrei


More information about the Digitalmars-d mailing list