Automated source translation of C++ to D

Joakim via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 21 10:57:11 PDT 2014


On Thursday, 21 August 2014 at 10:00:43 UTC, Daniel Murphy wrote:
> "Joakim"  wrote in message 
> news:ysntkmioyndreuiiyqxx at forum.dlang.org...
>
>> C++ support keeps coming up these days, with Andrei 
>> continually stressing it as something to work on.  How hard 
>> would it to be to write a C++->D translator, to allow people 
>> to translate C++ libraries to D?
>
> You might want to look at DDMD, which is automatically 
> converted.

Yes, I'm aware of ddmd.  You've mentioned many times that it only 
works because dmd is written using a very unC++-like style, to 
the point where github's source analyzer claims that dmd is 
written in 66.7% C, 28.4% D (presumably the tests right now), 
4.4% C++, and 0.5% other. :)

Given tools like libclang, how hard do you think it'd be to 
translate most of actual C++ to D?  If writing such a tool would 
mean that C++->D translation is the path of least effort for D 
users who want to integrate with C++, maybe that's the approach 
that should be taken instead.

I should note that I have no interest in any C++ libraries: I'm 
just throwing out this idea as an alternative to all the C++ 
interfacing that's being considered for D right now.


More information about the Digitalmars-d mailing list