D to C++

Laeeth Isharc via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 31 09:36:36 PDT 2016


On Wednesday, 31 August 2016 at 12:19:33 UTC, Cauterite wrote:
> On Wednesday, 31 August 2016 at 11:43:12 UTC, Nick wrote:
>> That's quite nice, but not what I'm looking for.
>> What Calypso does, as far as I can see, is to make it possible 
>> to compile C++ and D together. I'm looking for a compiler that 
>> takes in D code and spits out either C or C++ code.
>
> Your best option would be to use LDC with a C backend:
> https://www.google.com/search?q=llvm++c+backend
> No idea how well supported this is, I've never used LLVM myself.

Julia guys resurrected the C back end for LLVM.  Chap here posted 
about using this to compile D to bitcode to C to JS (last but 
using emscripten).  Even without last stage,  doesn't sound a 
great idea if you are under time pressure,  as the whole process 
is quite fragile.

It would be nice to have a robust C backend, even bearing in mind 
all problems with UB and difficulties one can imagine that might 
cause.




More information about the Digitalmars-d-learn mailing list