C++ Binding Generator

Joao Matos joao at tritao.eu
Tue Feb 18 05:14:55 PST 2014


On Tuesday, 18 February 2014 at 07:49:20 UTC, Andrej Mitrovic 
wrote:
> On 2/18/14, Joao Matos <joao at tritao.eu> wrote:
>> Nice tools, I've also been working on a C++ binding tool myself
>> (mostly C#/.NET though).
>>
>> https://github.com/mono/CppSharp
>
> Does this use Clang's C++ API or libclang which is a C API? If 
> the
> former, I didn't know you could call into C++ code from C#, at 
> least
> not very easily. Was it hard to do? I guess I'm looking for any
> experiences you can share.

I actually started with the libclang C API but found out that it 
was too limited, so I switched to the C++ one.

Well, .NET can actually call directly into C++ via C++/CLI (it's 
limited to Windows though) so that's what the first parser relied 
on. We now have a second parser that uses pure C++ and uses 
CppSharp to generate C# and bootstrap itself so that it can work 
on all platforms.

And yes, it's been pretty hard to do, binding C++ _is_ hard, 
though D should have a big advantage here, it's semantics are 
closer to C++ than many other languages.


More information about the Digitalmars-d mailing list