DI Generation Needs your Help!
Adam Wilson
flyboynw at gmail.com
Mon Dec 19 09:26:48 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.
Added to my list. :-)
>> 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.
Ok, this is a good reason, I'd still like to hear from Walter on the
subject, but I think he'll probably agree. I'll add it to my list.
> 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!
Thank you! I have to admit that reason I took it on is because it was
annoying the daylights out of me on my project, but then I guess that's
how most open-source work gets done. :-)
> 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.
Now that is a good idea. I may need some help getting the test setup as
I've never built anything as big as phobos before, but it would be a
fantastic way to nail down the DI behavior and maybe help push Phobos to
become a shared library.
> Thanks,
>
> Andrei
--
Adam Wilson
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/
More information about the Digitalmars-d
mailing list