Is the use of .di depreceated ?

Adam Wilson flyboynw at gmail.com
Mon Apr 23 18:51:24 PDT 2012


On Wed, 18 Apr 2012 03:02:49 -0700, Robert Clipsham  
<robert at octarineparrot.com> wrote:

> On 18/04/2012 09:18, "Erèbe" wrote:
>> Hi,
>>
>> I recently discovered that D support file interface .di, but through my
>> past reads I never seen someone using it. The std don't do usage of it
>> (compile time issue maybe ?) and most of D project are in the same case.
>>
>> Is this feature depreceated ?
>>
>> I'm from a C++ background, I agree on the fact that keeping declarations
>> and implementaions sync across two files is tedious, but when I have to
>> read code, I like a clean interface to summarize the thing.
>>
>> Dmd doc is there to replace the need of an clean interface ?
>
> You can find a list of deprecated features here:
>
> http://dlang.org/deprecate
>
> .di files are not deprecated, just rarely used. This is for a few  
> reasons:
>   * There is no requirement to use them
>   * They severely limit the capabilities of CTFE  
> (http://dlang.org/function#interpretation)
>   * DMD is really fast - the speed gain from using .di files isn't  
> noticeable for a lot of projects
>   * If you want them, they're very easy to generate yourself (use the  
> -Dd and -Df compiler switches)
>   * For the purposes of reading APIs, DDoc is normally used -  
> alternatively, all good editors and IDEs provide code folding to hide  
> implementations
>

Where DI files come in handy is for commercial libraries that don't want  
to hand out their source, without DI's that's impossible, therefore for D  
to be a commercially acceptable language, DI's must work, unfortunately,  
DI's do not auto-generate to the this requirement right now, I have a  
patch to fix that. But if you are OSS, you don't really care, just deliver  
the source as the "library".

-- 
Adam Wilson
IRC: LightBender
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/


More information about the Digitalmars-d mailing list