View mode: basic / threaded / horizontal-split · Log in · Help
November 25, 2005
.NET from D
At least a couple of people were interested in using .NET from D. The 
attached example shows one way of doing it, without hosting the CLR.

Here's a taster:

   _ArrayList arrayList = ArrayList.createObject!(_ArrayList);
   ICollection collection = com_cast!(ICollection)(arrayList);
   int index;
   collection.add(VARIANT(12345), index);

   VARIANT v;
   collection.get_Item(index, v);
   writefln(v.lVal);

Note that the attached files include only the bare minimum to get the 
example to run. I've not defined all the CLR types and some are merely 
placeholders. I've only tested this with .NET 2.0 (but it should work with 
1.0/1.1).

Enjoy.
November 25, 2005
Re: .NET from D
John C wrote:
> At least a couple of people were interested in using .NET from D. The 
> attached example shows one way of doing it, without hosting the CLR.
> 
> Here's a taster:
> 
>     _ArrayList arrayList = ArrayList.createObject!(_ArrayList);
>     ICollection collection = com_cast!(ICollection)(arrayList);
>     int index;
>     collection.add(VARIANT(12345), index);
> 
>     VARIANT v;
>     collection.get_Item(index, v);
>     writefln(v.lVal);
> 
> Note that the attached files include only the bare minimum to get the 
> example to run. I've not defined all the CLR types and some are merely 
> placeholders. I've only tested this with .NET 2.0 (but it should work with 
> 1.0/1.1).
> 
> Enjoy. 
> 

Very very interesting, i didn't know it was possible. But IMO too hard 
to use in real life.
November 26, 2005
Re: .NET from D
On Fri, 25 Nov 2005 17:44:32 -0000, "John C" <johnch_atms@hotmail.com>
wrote:

>At least a couple of people were interested in using .NET from D. The 
>attached example shows one way of doing it, without hosting the CLR.
>
>Here's a taster:
>
>    _ArrayList arrayList = ArrayList.createObject!(_ArrayList);
>    ICollection collection = com_cast!(ICollection)(arrayList);
>    int index;
>    collection.add(VARIANT(12345), index);
>
>    VARIANT v;
>    collection.get_Item(index, v);
>    writefln(v.lVal);
>
>Note that the attached files include only the bare minimum to get the 
>example to run. I've not defined all the CLR types and some are merely 
>placeholders. I've only tested this with .NET 2.0 (but it should work with 
>1.0/1.1).
>
>Enjoy. 
>

very nice proof of concept. I know others have various reasons for
wanting to, but I personally have no interest in using .NET classes in
D.
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.

Chris
November 26, 2005
Re: .NET from D
Chris wrote:
> 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.
> 

Cool! Can't wait! :)
November 26, 2005
Re: .NET from D
Hello,

i found this link
https://mywebspace.wisc.edu/daaugustine/web/d/
from Deja Augustine

Manfed


Chris wrote:

> On Fri, 25 Nov 2005 17:44:32 -0000, "John C" <johnch_atms@hotmail.com>
> wrote:
> 
>>At least a couple of people were interested in using .NET from D. The
>>attached example shows one way of doing it, without hosting the CLR.
>>
>>Here's a taster:
>>
>>    _ArrayList arrayList = ArrayList.createObject!(_ArrayList);
>>    ICollection collection = com_cast!(ICollection)(arrayList);
>>    int index;
>>    collection.add(VARIANT(12345), index);
>>
>>    VARIANT v;
>>    collection.get_Item(index, v);
>>    writefln(v.lVal);
>>
>>Note that the attached files include only the bare minimum to get the
>>example to run. I've not defined all the CLR types and some are merely
>>placeholders. I've only tested this with .NET 2.0 (but it should work with
>>1.0/1.1).
>>
>>Enjoy.
>>
> 
> very nice proof of concept. I know others have various reasons for
> wanting to, but I personally have no interest in using .NET classes in
> D.
> 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.
> 
> Chris
November 26, 2005
Re: .NET from D
"Ivan Senji" <ivan.senji_REMOVE_@_THIS__gmail.com> wrote in message 
news:dm7vvr$1njo$1@digitaldaemon.com...
> John C wrote:
>> At least a couple of people were interested in using .NET from D. The 
>> attached example shows one way of doing it, without hosting the CLR.
>>
>> Here's a taster:
>>
>>     _ArrayList arrayList = ArrayList.createObject!(_ArrayList);
>>     ICollection collection = com_cast!(ICollection)(arrayList);
>>     int index;
>>     collection.add(VARIANT(12345), index);
>>
>>     VARIANT v;
>>     collection.get_Item(index, v);
>>     writefln(v.lVal);
>>
>> Note that the attached files include only the bare minimum to get the 
>> example to run. I've not defined all the CLR types and some are merely 
>> placeholders. I've only tested this with .NET 2.0 (but it should work 
>> with 1.0/1.1).
>>
>> Enjoy.
>
> Very very interesting, i didn't know it was possible. But IMO too hard to 
> use in real life.
>

Quite. And indeed it is rare. But reasons do exist for wanting to run CLR 
code from unmanaged apps. There are some fairly large products that do so - 
Microsoft Office, SQL Server, Viruoso, DB2 and of course Visual Studio.
November 26, 2005
Re: .NET from D
"Chris" <ctlajoie@yahoo.com> wrote in message 
news:h83go15mparb57e1f5d7uroprpo13seb0f@4ax.com...
> On Fri, 25 Nov 2005 17:44:32 -0000, "John C" <johnch_atms@hotmail.com>
> wrote:
>
>>At least a couple of people were interested in using .NET from D. The
>>attached example shows one way of doing it, without hosting the CLR.
>>
>>Here's a taster:
>>
>>    _ArrayList arrayList = ArrayList.createObject!(_ArrayList);
>>    ICollection collection = com_cast!(ICollection)(arrayList);
>>    int index;
>>    collection.add(VARIANT(12345), index);
>>
>>    VARIANT v;
>>    collection.get_Item(index, v);
>>    writefln(v.lVal);
>>
>>Note that the attached files include only the bare minimum to get the
>>example to run. I've not defined all the CLR types and some are merely
>>placeholders. I've only tested this with .NET 2.0 (but it should work with
>>1.0/1.1).
>>
>>Enjoy.
>>
>
> very nice proof of concept. I know others have various reasons for
> wanting to, but I personally have no interest in using .NET classes in
> D.
> 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.
>
> Chris

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?
November 26, 2005
Re: .NET from D
John C 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? 
> 

It would make a lot sense, maybe dmdfe would be a good start?
November 26, 2005
Re: .NET from D
John C wrote:
> At least a couple of people were interested in using .NET from D. The 
> attached example shows one way of doing it, without hosting the CLR.
> 
> Here's a taster:
> 
>     _ArrayList arrayList = ArrayList.createObject!(_ArrayList);
>     ICollection collection = com_cast!(ICollection)(arrayList);
>     int index;
>     collection.add(VARIANT(12345), index);
> 
>     VARIANT v;
>     collection.get_Item(index, v);
>     writefln(v.lVal);
> 
> Note that the attached files include only the bare minimum to get the
> example to run. I've not defined all the CLR types and some are
> merely placeholders. I've only tested this with .NET 2.0 (but it
> should work with 1.0/1.1).

Excellent!

Just read through the zip, already now it has enormous value. I've been 
putting off certain Windows projects, but this is the straw that broke 
my procrastination!

Something else I'll use this for: flaunting around with this impresses a 
lot of Suits and Pointy-haireds. Yet more fuel to D-evangelizing!

(I know, i know, but it's like when people buy digital cameras, there 
just absolutely has to be the maximum pixels you can buy -- and then 
everybody turns the knob to 1024x768 anyway. What a joke.)

> Enjoy. 

You bet!
November 26, 2005
Re: .NET from D
On Sat, 26 Nov 2005 11:03:07 +0100, Manfred Hansen
<manfred@toppoint.de> wrote:

>Hello,
>
>i found this link
>https://mywebspace.wisc.edu/daaugustine/web/d/
>from Deja Augustine
>
>Manfed

Nice find! I don't want to get the old framework just to decompile
that. I was able to look at the class structure in it though and it
looks like he took the D frontend and changed for his compiler.

Chris
« First   ‹ Prev
1 2 3
Top | Discussion index | About this forum | D home