Thread overview
interop with other environments
Apr 26, 2007
mike
Apr 26, 2007
Alexander Panek
Apr 26, 2007
Max Samukha
Apr 26, 2007
Alexander Panek
Apr 26, 2007
Dan
Apr 26, 2007
jcc7
Apr 27, 2007
mike
Apr 27, 2007
Bill Baxter
Apr 26, 2007
jcc7
April 26, 2007
Hello,

I really like D syntax and would like to create one library in D language. Now, is it possible to use this library in .NET, Python, Ruby or PHP? How it could be done? You don't have to explain all, just point me please in the right direction. I was trying to find some more information but the fact that the language is called "D", it's pretty hard to google these things.
April 26, 2007
mike wrote:

> the fact that the language is called "D", it's pretty hard to google these things.

No, it doesn't. You google for "D language" or "D programming language".

Or: http://directory.google.com/Top/Computers/Programming/Languages/D/

--anders
April 26, 2007
On Thu, 26 Apr 2007 02:49:34 -0400
mike <mike@nospam.com> wrote:

> Hello,
> 
> I really like D syntax and would like to create one library in D language. Now, is it possible to use this library in .NET, Python, Ruby or PHP? How it could be done? You don't have to explain all, just point me please in the right direction. I was trying to find some more information but the fact that the language is called "D", it's pretty hard to google these things.

As long as there is a C bridge possible, you can use almost any library you wish. I don't know whether that's possible with .NET, but the other ones shouldn't be a problem.

You might be interested in PyD[1], and bcd.gen[2].

Kind regards,
Alex

[1] http://dsource.org/projects/pyd
[2] http://dsource.org/projects/bcd
April 26, 2007
On Thu, 26 Apr 2007 09:56:54 +0200, Alexander Panek <alexander.panek@brainsware.org> wrote:

>On Thu, 26 Apr 2007 02:49:34 -0400
>mike <mike@nospam.com> wrote:
>
>> Hello,
>> 
>> I really like D syntax and would like to create one library in D language. Now, is it possible to use this library in .NET, Python, Ruby or PHP? How it could be done? You don't have to explain all, just point me please in the right direction. I was trying to find some more information but the fact that the language is called "D", it's pretty hard to google these things.
>
>As long as there is a C bridge possible, you can use almost any library you wish. I don't know whether that's possible with .NET, but the other ones shouldn't be a problem.
>
>You might be interested in PyD[1], and bcd.gen[2].
>
>Kind regards,
>Alex
>
>[1] http://dsource.org/projects/pyd
>[2] http://dsource.org/projects/bcd

Using what they call P/Invoke, you should be able to access from a .NET assembly any C functions exported by a dll compiled from D source. If you are adventurous enough you could even try to create a COM wrapper around a .NET assembly and use it from D.
April 26, 2007
On Thu, 26 Apr 2007 13:06:03 +0300
Max Samukha <samukha@voliacable.com> wrote:
> Using what they call P/Invoke, you should be able to access from a .NET assembly any C functions exported by a dll compiled from D source. If you are adventurous enough you could even try to create a COM wrapper around a .NET assembly and use it from D.

:O

That sounds disgusting and evul!

*hides*
April 26, 2007
== Quote from mike (mike@nospam.com)'s article
...
> I was trying to find some more information but the fact that the language is called "D", it's pretty hard to google these things.

It's not really as hard as you make it seem (and it keeps on getting easier). Maybe you could benefit from a few tips:

http://www.prowiki.org/wiki4d/wiki.cgi?SearchingTips
April 26, 2007
Alexander Panek Wrote:

> On Thu, 26 Apr 2007 13:06:03 +0300
> Max Samukha <samukha@voliacable.com> wrote:
> > Using what they call P/Invoke, you should be able to access from a .NET assembly any C functions exported by a dll compiled from D source. If you are adventurous enough you could even try to create a COM wrapper around a .NET assembly and use it from D.
> 
> :O
> 
> That sounds disgusting and evul!
> 
> *hides*

I don't think Microsoft is evil, I just think their programmers are overpaid, and their marketers underpaid.

Yeah, using a Microsoft interface spec to access stuff from a Microsoft runtime environment written in a Microsoft programming language sounds disgusting all right.

But... some people like it dirty.
April 26, 2007
== Quote from Alexander Panek (alexander.panek@brainsware.org)'s article
> On Thu, 26 Apr 2007 13:06:03 +0300
> Max Samukha <samukha@voliacable.com> wrote:
> > Using what they call P/Invoke, you should be able to access from a .NET assembly any C functions exported by a dll compiled from D source. If you are adventurous enough you could even try to create a COM wrapper around a .NET assembly and use it from D.
> :O
> That sounds disgusting and evul!
> *hides*

Well, I won't argue that ethics of such a choice ( ;) ), but it should be possible.

I created a COM library with VB.NET. I just used Juno (oldrev's version) to create an object from the COM library in a D program. I don't know how practical it is, but it come in handy.

jcc7
April 27, 2007
Thank you all for feedback, I'm really surprised how active and useful this mailing-list is.

Max,

you said, I could have "C functions exported by a dll compiled from D source" and I think this is actually what I'm looking for. Do you know how it could be done?

Thanks

> Using what they call P/Invoke, you should be able to access from a .NET assembly any C functions exported by a dll compiled from D source. If you are adventurous enough you could even try to create a COM wrapper around a .NET assembly and use it from D.

April 27, 2007
mike wrote:
> Thank you all for feedback, I'm really surprised how active and useful this mailing-list is.
> 
> Max,
> 
> you said, I could have "C functions exported by a dll compiled from D source" and I think this is actually what I'm looking for. Do you know how it could be done?
> 
> Thanks
> 
>> Using what they call P/Invoke, you should be able to access from a
>> .NET assembly any C functions exported by a dll compiled from D
>> source. If you are adventurous enough you could even try to create a
>> COM wrapper around a .NET assembly and use it from D.
> 

For DMD on Windows, this is what you want:
   http://www.digitalmars.com/d/dll.html

--bb