December 21, 2011
On Wed, 21 Dec 2011 08:41:43 -0800, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:

> On 12/21/11 2:12 AM, Adam Wilson wrote:
>> On Tue, 20 Dec 2011 04:41:11 -0800, Andrei Alexandrescu
>> <SeeWebsiteForEmail@erdani.org> wrote:
>>
>>> On 12/20/11 2:03 AM, Adam Wilson wrote:
>>>> On Mon, 19 Dec 2011 00:11:25 -0800, Adam Wilson <flyboynw@gmail.com>
>>>> wrote:
>>>>
>>>> The latest DI generation code is now on my Git account and ready for
>>>> testing. It fixes the following issues:
>>>>
>>>> 1. Privates should exist in the DI file to support public templates.
>>>> 2. Template classes and functions retain their implementations.
>>>> 3. Immutable types should retain their initializers.
>>>
>>> Great!
>>>
>>>> At this point I could really use testing; you can download them from my
>>>> git account here: https://LightBender@github.com/LightBender/dmd.git
>>>> I am trying to get myself setup for building phobos as a test but this
>>>> is proving to be a lengthy process.
>>>
>>> Nah, it's much easier than you might think. The posix.mak makefile is
>>> very small for what it does, and you need to literally change one line
>>> of code to make it generate .di headers.
>>>
>>>
>>> Andrei
>>
>> Is it be add the proper -H options? I'll try it tomorrow, events pretty
>> much overran my day today. If the new DI gen can build valid Phobos DI's
>> I think it is time to consider opening a pull request and get feedback
>> from the maintainers. Any disagreement with that?
>
> I don't think we'll use .di for phobos for the time being. I was suggesting you do so in order to look over the generated .di files and make sure they work.
>
> Andrei

Oops! I mean't a pull on dmd for the new DI code. Sorry for the confusion!

-- 
Adam Wilson
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/
December 21, 2011
On 12/21/11 10:42 AM, Adam Wilson wrote:
> Oops! I mean't a pull on dmd for the new DI code. Sorry for the confusion!

Yes, absolutely!

Andrei
December 21, 2011
On Wednesday, 21 December 2011 at 16:42:59 UTC, Adam Wilson wrote:
> Oops! I mean't a pull on dmd for the new DI code. Sorry for the confusion!

Pull requests are always appreciated! :)

Remember, it's more like "please-review-and-pull-if-of-acceptable-quality request" :P
December 22, 2011
The latest DI generation code is now on my Git account and ready for testing. It fixes the following issues:

1.	Variables in template functions/classes would be stripped of their initializers.
2.	Manifest Constants would lose their initializers.

DI generation is getting close! Every Phobos DI module I've tried has passed the VisualD parser/lexer (for whatever that is worth). I want to do some build testing with those files, but even complicated modules like std.algorithm and std.regex are passing the lexer/parser. If everything goes well with that testing I'll open up a pull for dmd. Hopefully proper DI generation will make it into 2.058!
You can get the latest from my git account here: https://LightBender@github.com/LightBender/dmd.git

-- 
Adam Wilson
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/
December 22, 2011
On 2011-12-22 08:07, Adam Wilson wrote:
> The latest DI generation code is now on my Git account and ready for
> testing. It fixes the following issues:
>
> 1. Variables in template functions/classes would be stripped of their
> initializers.
> 2. Manifest Constants would lose their initializers.
>
> DI generation is getting close! Every Phobos DI module I've tried has
> passed the VisualD parser/lexer (for whatever that is worth). I want to
> do some build testing with those files, but even complicated modules
> like std.algorithm and std.regex are passing the lexer/parser. If
> everything goes well with that testing I'll open up a pull for dmd.
> Hopefully proper DI generation will make it into 2.058!
> You can get the latest from my git account here:
> https://LightBender@github.com/LightBender/dmd.git
>

Can the generator handle this:

id objc_msgSend (ARGS...)(id theReceiver, SEL theSelector, ARGS args)
{
    alias extern (C) id function (id, SEL, ARGS) fp;
    return (cast(fp)&c_objc_msgSend)(theReceiver, theSelector, args);
}

I know it had problems with that, at least in previous versions of DMD.

-- 
/Jacob Carlborg
December 22, 2011
On 12/22/11 1:07 AM, Adam Wilson wrote:
> The latest DI generation code is now on my Git account and ready for
> testing. It fixes the following issues:
>
> 1. Variables in template functions/classes would be stripped of their
> initializers.
> 2. Manifest Constants would lose their initializers.
>
> DI generation is getting close! Every Phobos DI module I've tried has
> passed the VisualD parser/lexer (for whatever that is worth). I want to
> do some build testing with those files, but even complicated modules
> like std.algorithm and std.regex are passing the lexer/parser. If
> everything goes well with that testing I'll open up a pull for dmd.
> Hopefully proper DI generation will make it into 2.058!
> You can get the latest from my git account here:
> https://LightBender@github.com/LightBender/dmd.git
>

Great! Did you fix indentation?

Also, I think testing with Visual Studio is insufficient. One good test is to extract all unittest code from std modules, and then make sure it compiles and runs when you only import the .di files.

Andrei
December 22, 2011
On Thu, 22 Dec 2011 08:46:39 -0800, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:

> On 12/22/11 1:07 AM, Adam Wilson wrote:
>> The latest DI generation code is now on my Git account and ready for
>> testing. It fixes the following issues:
>>
>> 1. Variables in template functions/classes would be stripped of their
>> initializers.
>> 2. Manifest Constants would lose their initializers.
>>
>> DI generation is getting close! Every Phobos DI module I've tried has
>> passed the VisualD parser/lexer (for whatever that is worth). I want to
>> do some build testing with those files, but even complicated modules
>> like std.algorithm and std.regex are passing the lexer/parser. If
>> everything goes well with that testing I'll open up a pull for dmd.
>> Hopefully proper DI generation will make it into 2.058!
>> You can get the latest from my git account here:
>> https://LightBender@github.com/LightBender/dmd.git
>>
>
> Great! Did you fix indentation?
>
> Also, I think testing with Visual Studio is insufficient. One good test is to extract all unittest code from std modules, and then make sure it compiles and runs when you only import the .di files.
>
> Andrei

No I haven't, there is an open pull for something about indentations, so I wasn't sure if I needed to. I will certainly do what I can for indentations, but the generation process is a bit messy so I can't promise it will be perfect.

I completely agree, it's just the baseline sanity check I'm using while I hack on it. Unless there is a way to export the unit tests automatically, I don't have the time to hand port all the unit tests for Phobos. I think I'll just pick a few modules with differing levels of complexity and use those unit tests.

-- 
Adam Wilson
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/
December 22, 2011
On Wed, 21 Dec 2011 23:43:56 -0800, Jacob Carlborg <doob@me.com> wrote:

> On 2011-12-22 08:07, Adam Wilson wrote:
>> The latest DI generation code is now on my Git account and ready for
>> testing. It fixes the following issues:
>>
>> 1. Variables in template functions/classes would be stripped of their
>> initializers.
>> 2. Manifest Constants would lose their initializers.
>>
>> DI generation is getting close! Every Phobos DI module I've tried has
>> passed the VisualD parser/lexer (for whatever that is worth). I want to
>> do some build testing with those files, but even complicated modules
>> like std.algorithm and std.regex are passing the lexer/parser. If
>> everything goes well with that testing I'll open up a pull for dmd.
>> Hopefully proper DI generation will make it into 2.058!
>> You can get the latest from my git account here:
>> https://LightBender@github.com/LightBender/dmd.git
>>
>
> Can the generator handle this:
>
> id objc_msgSend (ARGS...)(id theReceiver, SEL theSelector, ARGS args)
> {
>      alias extern (C) id function (id, SEL, ARGS) fp;
>      return (cast(fp)&c_objc_msgSend)(theReceiver, theSelector, args);
> }
>
> I know it had problems with that, at least in previous versions of DMD.

Well, without the accompanying types that are used in the declaration I'm not entire sure how I could give you a good answer. However, since it's a template function, I can say that template functions in DI files are basically straight implementation dumps of the D file. Can you tell me where DI generation hiccups in that code? If the hiccup is inside the function impl than I doubt anything I've changed will fix your error.

-- 
Adam Wilson
Project Coordinator
The Horizon Project
http://www.thehorizonproject.org/
December 22, 2011
On 2011-12-22 18:33, Adam Wilson wrote:
> On Wed, 21 Dec 2011 23:43:56 -0800, Jacob Carlborg <doob@me.com> wrote:
>
>> On 2011-12-22 08:07, Adam Wilson wrote:
>>> The latest DI generation code is now on my Git account and ready for
>>> testing. It fixes the following issues:
>>>
>>> 1. Variables in template functions/classes would be stripped of their
>>> initializers.
>>> 2. Manifest Constants would lose their initializers.
>>>
>>> DI generation is getting close! Every Phobos DI module I've tried has
>>> passed the VisualD parser/lexer (for whatever that is worth). I want to
>>> do some build testing with those files, but even complicated modules
>>> like std.algorithm and std.regex are passing the lexer/parser. If
>>> everything goes well with that testing I'll open up a pull for dmd.
>>> Hopefully proper DI generation will make it into 2.058!
>>> You can get the latest from my git account here:
>>> https://LightBender@github.com/LightBender/dmd.git
>>>
>>
>> Can the generator handle this:
>>
>> id objc_msgSend (ARGS...)(id theReceiver, SEL theSelector, ARGS args)
>> {
>> alias extern (C) id function (id, SEL, ARGS) fp;
>> return (cast(fp)&c_objc_msgSend)(theReceiver, theSelector, args);
>> }
>>
>> I know it had problems with that, at least in previous versions of DMD.
>
> Well, without the accompanying types that are used in the declaration
> I'm not entire sure how I could give you a good answer. However, since
> it's a template function, I can say that template functions in DI files
> are basically straight implementation dumps of the D file. Can you tell
> me where DI generation hiccups in that code? If the hiccup is inside the
> function impl than I doubt anything I've changed will fix your error.
>

Never mind, it seems to be working.

-- 
/Jacob Carlborg
December 23, 2011
On Thu, 22 Dec 2011 13:02:49 -0800, Jacob Carlborg <doob@me.com> wrote:

> On 2011-12-22 18:33, Adam Wilson wrote:
>> On Wed, 21 Dec 2011 23:43:56 -0800, Jacob Carlborg <doob@me.com> wrote:
>>
>>> On 2011-12-22 08:07, Adam Wilson wrote:
>>>> The latest DI generation code is now on my Git account and ready for
>>>> testing. It fixes the following issues:
>>>>
>>>> 1. Variables in template functions/classes would be stripped of their
>>>> initializers.
>>>> 2. Manifest Constants would lose their initializers.
>>>>
>>>> DI generation is getting close! Every Phobos DI module I've tried has
>>>> passed the VisualD parser/lexer (for whatever that is worth). I want to
>>>> do some build testing with those files, but even complicated modules
>>>> like std.algorithm and std.regex are passing the lexer/parser. If
>>>> everything goes well with that testing I'll open up a pull for dmd.
>>>> Hopefully proper DI generation will make it into 2.058!
>>>> You can get the latest from my git account here:
>>>> https://LightBender@github.com/LightBender/dmd.git
>>>>
>>>
>>> Can the generator handle this:
>>>
>>> id objc_msgSend (ARGS...)(id theReceiver, SEL theSelector, ARGS args)
>>> {
>>> alias extern (C) id function (id, SEL, ARGS) fp;
>>> return (cast(fp)&c_objc_msgSend)(theReceiver, theSelector, args);
>>> }
>>>
>>> I know it had problems with that, at least in previous versions of DMD.
>>
>> Well, without the accompanying types that are used in the declaration
>> I'm not entire sure how I could give you a good answer. However, since
>> it's a template function, I can say that template functions in DI files
>> are basically straight implementation dumps of the D file. Can you tell
>> me where DI generation hiccups in that code? If the hiccup is inside the
>> function impl than I doubt anything I've changed will fix your error.
>>
>
> Never mind, it seems to be working.

Did you check it against my forked code? I want to make sure that there are as few errors as possible before I open up the pull. :-)

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