Using D programming language in a .NET context

我的未来我决定 提交于 2019-11-28 13:19:48

Using D together with .NET is very possible. The reason:

  • .NET is able to import unmanaged C libraries (.dll's which export C functions) using the dllImport attribute.
  • D is able to export C functions. using the export and extern (C) attributes

So the considering the technicalities, it's completely possible.

With regards to what D makes easier than C++, the answer is fairly easy: "Everything". In a sense, D is really just a copy of C++ with just about everything done simpler. Sure that's only a half story, but reasonably true.

http://the-free-meme.blogspot.com/ is a blog by someone who is working on getting d on dot net.

Edit:

nanu and nono are projects that are trying to get mono/D working but both have not had any changes in there svn /trunk in the last year.

You can call a D DLL by creating a DLL with a C Interface, and then calling it via P/Invoke from .NET.

There is also D for .NET which is a way of compiling D code right to CIL.

The other answers are correct in that sharing code with the native implementation is easy too.

I believe D can call .NET assemlies visible via COM: http://wiki.dlang.org/COM_Programming.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!