My idea for seamless interop to C++

Petar Petar
Thu Nov 19 07:37:52 UTC 2020


On Thursday, 19 November 2020 at 07:02:58 UTC, Jacob Carlborg 
wrote:
> On Wednesday, 18 November 2020 at 23:32:00 UTC, Petar Kirov 
> [ZombineDev] wrote:
>
>> 5. Calypso - using Qt from D is nothing sort of astonishing! 
>> Unfortunately all the work is done by single developer. If 
>> others would join, hopefully the project could progress much 
>> faster.
>
> As far as I recall, this is using libclang built-in into LDC. 
> This would limit the usage to LDC.

Yes, this project is completely tied to LDC. However, it is the 
one also offering the tightest C++-interop (except for the 
cling-based approach, for which idk - a dconf presentation would 
be nice). The integration has several noticeable advantages:
1. It is using the C++-based libclang API, which from what I've 
heard offers much more than the C wrapper-based one.
2. I don't know the specifics, but AFAIR, the integration point 
is not actually the parsed AST, but actually more closer to the 
mid-layer, so it has much more semantic information and doesn't 
need to use D's extern (C++) support (though that certainly 
helps), as it can do things on the Clang/LLVM-level.
3. It deeply integrates also with DMDFE in order to bridge the 
clang AST and the DMD AST and even makes additions to D itself, 
in order to enable things like C++ overload resolution.
(I'm not involved with the project, so I may be misremembering or 
misrepresenting some details, but that's some of the high-level 
stuff, AFAIR.)

Unfortunately, 1. and 2. are also the project's biggest weakness 
(given the available man power), as C++ clang, LLVM and DMDFE 
APIs are pretty unstable, so I guess it requires extensive effort 
to rebase to the latest versions.

>
>> [3]: https://github.com/jacob-carlborg
>
> Correction: https://github.com/jacob-carlborg/dstep

Sorry for the typo.

dpp makes for some cool live demoes, but I've always preferred my 
source code committed to git, rather than just existing in-memory 
(well unless it's well-written CTFE code :D), so dstep has been 
my preferred choice for C HtoD. Huge thank you for it! :)



More information about the Digitalmars-d mailing list