DI Generation Needs your Help!

Adam Wilson flyboynw at gmail.com
Mon Dec 19 23:58:52 PST 2011


On Mon, 19 Dec 2011 08:53:21 -0800, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> On 12/19/11 2:11 AM, Adam Wilson wrote:
>> As you may all be aware, I've been trying to improve the automated
>> generation of .di files and I now have something that I feel is
>> testable. Currently the new code only makes the following changes.
>>
>> 1. Function Implementations are removed
>> 2. Private Function Declarations are removed.
>> 3. Variable Initializers, except for const, are removed.
>
> Don't forget immutable.

I did it, but it wasn't pretty. I had to pass the immutable state via the  
HeaderGenState struct.

>> Everything else is left alone. Templates and mixins are not addressed
>> with this code and *should* not be modified. That's where I need your
>> help, the test cases I have written cover some basic scenarios but I
>> don't have the capability to test these changes with the diverse code
>> base that the community has created.
>>
>> drey_ from IRC was kind enough to test build Derelict with the changes
>> and has discovered a potential issue around private imports. Derelict
>> uses private imports that contain types which are used in function alias
>> declarations. As one would expect, this caused many compiler errors.
>> Currently, I feel that private imports should be stripped from the DI
>> file as they are intended to be internal to the module. However, I want
>> to put it to the community to decide, and I would especially appreciate
>> Mr. Bright's opinion on private imports in DI files.
>
> I suspect you'd still need the private imports because template code may  
> use them.

Privates are now all in.

> This is great work. It's almost a textbook example of how one can make a  
> great positive impact on D's development by finding an area of  
> improvement and working on it. Congratulations!
>
> You may want to generate DIs for Phobos and take a look at them. Phobos  
> uses a vast array of D's capabilities so it's an effective unittest for  
> DI generation.
>
>
> Thanks,
>
> Andrei


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


More information about the Digitalmars-d mailing list