Index » General » .NET from D (page 3)

November 27, 2005
J C Calvarese wrote:
> In article <d1mho11g54e2iv8i2fovn5rb1as7eoel6s@4ax.com>, Chris says...
> 
>>On Sat, 26 Nov 2005 10:35:26 -0000, "John C" <johnch_atms@hotmail.com>
>>wrote:
>>
>>>It would seem there are several people in this group doing the same thing - would it not make sense to join forces to get a fully functional D.NET compiler out the door? 
>>>
>>
>>Who else is currently working on one? I recall one or two who said
>>they would help if there was an open source project, but I don't
>>remember anyone saying they were already working on one (except Deja
>>Augustine over a year ago. his compiler wasn't open source anyway). 
>>
>>Mine will be open source, perhaps on sourceforge (I believe dsource is
>>for D projects only). If anyone knows where I should host it I'm open
>>to suggestions. I prefer to use svn instead of cvs. 
>>
>>Chris
> 
> 
> I think to be eligible for dsource a project needs to be open source and either
> using D or related to D. It sounds like your project would be closely related to
> D (create a language similar to D that uses .NET, right?). It might even be
> based on the DMD's front-end code.
> 
> By the way, the idea of a D.NET has already been discussed in a dsource topic:
> http://www.dsource.org/forums/viewtopic.php?t=140
> 
> (It was more a conceptual discussion than an actual request to start a project.)
> 
> jcc7

Heh... and I was one of the ones originally against it.  But things change...

I'm sure D on .NET is the idea.  I don't think the idea is to create a language similar to D.  The language is still D.  It just needs to interface with .NET.

-JJR
November 27, 2005
On Sat, 26 Nov 2005 14:39:14 -0800, John Reimer <terminal.node@gmail.com> wrote:

>Chris wrote:
>> On Sat, 26 Nov 2005 10:35:26 -0000, "John C" <johnch_atms@hotmail.com> wrote:
>> 
>>>It would seem there are several people in this group doing the same thing - would it not make sense to join forces to get a fully functional D.NET compiler out the door?
>>>
>> 
>> 
>> Who else is currently working on one? I recall one or two who said they would help if there was an open source project, but I don't remember anyone saying they were already working on one (except Deja Augustine over a year ago. his compiler wasn't open source anyway).
>> 
>> Mine will be open source, perhaps on sourceforge (I believe dsource is for D projects only). If anyone knows where I should host it I'm open to suggestions. I prefer to use svn instead of cvs.
>> 
>> Chris
>
>
>Talk to Brad at dsource.org.  I'm fairly certain he hosts any project that pertains to D, even if it isn't programmed in the D language itself.
>
>Example projects on dsource.org that are in other languages:
>
>eclipseD -- Java; plugin for Eclipse IDE
>H2D      -- C++; C header to D module conversion tool
>DManager -- Delphi; D Project Manager
>
>And there are others.
>
>-JJR

I'll ask Brad then. I'd prefer to have it on dsource as long as he doesn't mind.

Chris
November 27, 2005
On Sun, 27 Nov 2005 00:04:55 +0000 (UTC), J C Calvarese
<technocrat7@gmail.com> wrote:

>In article <d1mho11g54e2iv8i2fovn5rb1as7eoel6s@4ax.com>, Chris says...
>>
>>On Sat, 26 Nov 2005 10:35:26 -0000, "John C" <johnch_atms@hotmail.com> wrote:
>>>
>>>It would seem there are several people in this group doing the same thing - would it not make sense to join forces to get a fully functional D.NET compiler out the door?
>>>
>>
>>Who else is currently working on one? I recall one or two who said they would help if there was an open source project, but I don't remember anyone saying they were already working on one (except Deja Augustine over a year ago. his compiler wasn't open source anyway).
>>
>>Mine will be open source, perhaps on sourceforge (I believe dsource is for D projects only). If anyone knows where I should host it I'm open to suggestions. I prefer to use svn instead of cvs.
>>
>>Chris
>
>I think to be eligible for dsource a project needs to be open source and either using D or related to D. It sounds like your project would be closely related to D (create a language similar to D that uses .NET, right?). It might even be based on the DMD's front-end code.
>
>By the way, the idea of a D.NET has already been discussed in a dsource topic: http://www.dsource.org/forums/viewtopic.php?t=140
>
>(It was more a conceptual discussion than an actual request to start a project.)
>
>jcc7

I decided I would not use the DMD front-end as a basis for my
compiler. I would certainly use it as a reference, but my project will
be entirely in managed C# so it will also run on Mono on Linux and
Mac.
thanks for the link.

Chris
November 27, 2005
On Sat, 26 Nov 2005 16:13:26 -0800, John Reimer <terminal.node@gmail.com> wrote:

>> I think to be eligible for dsource a project needs to be open source and either using D or related to D. It sounds like your project would be closely related to D (create a language similar to D that uses .NET, right?). It might even be based on the DMD's front-end code.
>> 
>> By the way, the idea of a D.NET has already been discussed in a dsource topic: http://www.dsource.org/forums/viewtopic.php?t=140
>> 
>> (It was more a conceptual discussion than an actual request to start a project.)
>> 
>> jcc7
>
>Heh... and I was one of the ones originally against it.  But things change...
>
>I'm sure D on .NET is the idea.  I don't think the idea is to create a language similar to D.  The language is still D.  It just needs to interface with .NET.
>
>-JJR

I am not sure how we could use namespaces (.net) *and* modules (D). We could either add a namespace directive to D.NET, or we could the 'module' keyword indicate the namespace. either way, it is a deviation from the D spec.

Chris
November 27, 2005
In article <2i7io1p2amsbu0a0j6mpnc6j358ebmtep3@4ax.com>, Chris says...
>
>On Sat, 26 Nov 2005 16:13:26 -0800, John Reimer <terminal.node@gmail.com> wrote:
>
>>> I think to be eligible for dsource a project needs to be open source and either using D or related to D. It sounds like your project would be closely related to D (create a language similar to D that uses .NET, right?). It might even be based on the DMD's front-end code.
>>> 
>>> By the way, the idea of a D.NET has already been discussed in a dsource topic: http://www.dsource.org/forums/viewtopic.php?t=140
>>> 
>>> (It was more a conceptual discussion than an actual request to start a project.)
>>> 
>>> jcc7
>>
>>Heh... and I was one of the ones originally against it.  But things change...
>>
>>I'm sure D on .NET is the idea.  I don't think the idea is to create a language similar to D.  The language is still D.  It just needs to interface with .NET.
>>
>>-JJR
>
>I am not sure how we could use namespaces (.net) *and* modules (D). We could either add a namespace directive to D.NET, or we could the 'module' keyword indicate the namespace. either way, it is a deviation from the D spec.
>
>Chris

Might call it "D#" then. ;)

jcc7
November 28, 2005
Great stuff! If only the syntax could be streamlined a little...

L.


November 28, 2005
"Lionello Lunesu" <lio@remove.lunesu.com> wrote in message news:dmef4r$1no6$1@digitaldaemon.com...
> Great stuff! If only the syntax could be streamlined a little...
>
> L.

That's COM for you. In fact, as far as COM goes, that's pretty streamlined, since some functions like QueryInterface and CoCreateInstance are hidden from you in the templates.

You could also write wrapper classes so that it has a D interface:

class ArrayList {

private:

    _ArrayList clrArrayList_;
    ICollection clrCollection_;
    IList clrList_;

public:

    this() {
        clrArrayList_ =
cirrus.c.windows.clr.ArrayList.createObject!(_ArrayList);
        clrCollection_ = com_cast!(ICollection)(arrayList_);
        clrList_ = com_cast!(IList)(arrayList_);
    }

    ~this() {
        clrArrayList_.Release();
        clrCollection_.Release();
        clrList_.Release();
    }

    int add(VARIANT item) {
        int index;
        clrList_.Add(item, index);
        return index;
    }

    int indexOf(VARIANT item) {
        int result;
        clrList_.IndexOf(item, result);
        return result;
    }

    int count() {
        int result;
        clrCollection_.Count(result);
        return result;
    }

    VARIANT opIndex(int index) {
        VARIANT result;
        clrList_.get_Item(index, result);
        return result;
    }

    void opIndexAssign(VARIANT item, int index) {
        clrList_.put_Item(index, item);
    }

    int opApply(int delegate(inout VARIANT) d) {
        int r;
        for (int i = 0; i < count; i++) {
            VARIANT var;
            clrList_.get_Item(i, var);
            if ((r = d(var)) != 0)
                break;
        }
        return r;
    }

}

ArrayList list = new ArrayList;
list.add(VARIANT(12345));
list.add(VARIANT(67890));
foreach (VARIANT item; list) {
    printf("index %d = %d\n", list.indexOf(item), item.lVal);
}

That's a little better, and could be improved upon further by replacing VARIANT with a some fancy Object boxing/unboxing.


December 01, 2005
"Chris" <ctlajoie@yahoo.com> wrote in message news:h83go15mparb57e1f5d7uroprpo13seb0f@4ax.com...
> I am however very interested in compiling D (there would have to be some slight deviations in the syntax) directly to MSIL. In fact I'm reading up on compiler design and experimenting with a toy language I created that compiles to MSIL. Soon hopefully I will understand enough to begin writing one for D.

The book you want is: "Compiling for the .NET Common Language Runtime (CLR)"
by John Gough


Next ›   Last »
1 2 3
Top | Discussion index | About this forum | D home