Autowrap for .NET is Now Available

Adam Wilson flyboynw at gmail.com
Thu Dec 13 11:24:05 UTC 2018


I am pleased to announce that Autowrap has now gained the ability to 
generate .NET interfaces for D libraries! This means that if you have a 
D library that you would like to call from .NET you can now Autowrap it 
and use the library in .NET as if it were any other .NET assembly.

Autowrap will generate interfaces for the following features of D:

Primitive Types that map between the two languages (no cent/ucent/real)
Module-level Functions
Structs and Classes
   - Constructors
   - Fields
   - Properties
   - Methods
1-Dimensional Ranges

Please note that this is initial work and there may be bugs and things 
that don't work. For example we know the following things will not work:

SysTime/DateTime/UUID types
Multi-Dimensional Ranges
Templates
Delegates/Callbacks

Amoung the items that do work, 1D ranges have not been thoroughly tested 
and there may be corner cases around class/reference lifetime. At the 
moment, we only ensure that a D object that is referenced in C# code is 
pinned in the D GC until the C# GC runs the objects destructors. 
Therefore, multiple copies of the same D reference may experience 
use-after-free as the memory will be unpinned after the first destructor 
is called. For most scenarios this will not be a problem, but it is 
something to be aware of. I am exploring alternatives to handle this 
problem but nothing has yet been decided and I am curious what your 
opinions and experience would suggest.

Autowrap/.NET requires .NET Core 2.1 or greater and C# 7.3 or later.

More information can be found here:
GitHub Repo: https://github.com/kaleidicassociates/autowrap
DUB Package: http://code.dlang.org/packages/autowrap

I would like to thank Symmetry Investments for sponsoring this effort.

-- 
Adam Wilson
IRC: EllipticBit
import quiet.dlang.dev;


More information about the Digitalmars-d-announce mailing list