www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - LDC in D

reply "Jonathan Marler" <johnnymarler gmail.com> writes:
I know there's been developments in C++/D interop.  I'm wondering 
what parts are missing to be able to use the LLVM IR 
Codegeneration libraries in a D application?  I figured I'd ask 
the LDC guys since you have experience with both LLVM and D. 
Thanks.
Apr 23 2015
next sibling parent reply "Kagamin" <spam here.lot> writes:
You mean llvm bindings? 
https://github.com/deadalnix/SDC/tree/master/libd-llvm/import/llvm/c
Apr 24 2015
parent reply "Jonathan Marler" <johnnymarler gmail.com> writes:
On Friday, 24 April 2015 at 07:33:10 UTC, Kagamin wrote:
 You mean llvm bindings? 
 https://github.com/deadalnix/SDC/tree/master/libd-llvm/import/llvm/c
So is SDC just a rewrite of LDC in D?
Apr 24 2015
parent "Kai Nacke" <kai redstar.de> writes:
On Friday, 24 April 2015 at 13:24:31 UTC, Jonathan Marler wrote:
 On Friday, 24 April 2015 at 07:33:10 UTC, Kagamin wrote:
 You mean llvm bindings? 
 https://github.com/deadalnix/SDC/tree/master/libd-llvm/import/llvm/c
So is SDC just a rewrite of LDC in D?
No, SDC is a D compiler written from scratch in D, using LLVM as backend library. As LLVM is written in C/C++ bindings are required to use it with D. The SDC binding is one of several existing D bindings for LLVM. Regards, Kai
Apr 24 2015
prev sibling parent reply "Kai Nacke" <kai redstar.de> writes:
On Friday, 24 April 2015 at 05:36:10 UTC, Jonathan Marler wrote:
 I know there's been developments in C++/D interop.  I'm 
 wondering what parts are missing to be able to use the LLVM IR 
 Codegeneration libraries in a D application?  I figured I'd ask 
 the LDC guys since you have experience with both LLVM and D. 
 Thanks.
Hi Jonathan! There are several D bindings for LLVM which you can use. The drawback is that they all use the C interface which is sometimes a bit limited. I am not aware that there is a binding for the C++ interface. Regards, Kai
Apr 24 2015
parent reply Dan Olson <zans.is.for.cans yahoo.com> writes:
"Kai Nacke" <kai redstar.de> writes:
 There are several D bindings for LLVM which you can use.
 The drawback is that they all use the C interface which is sometimes a
 bit limited. I am not aware that there is a binding for the C++
 interface.
Kai, Just curious. When LDC moves to DDMD, is the plan to continue to use the LLVM C++ interface, perhaps making the C++ glue layer simple enough that D can handle properly, or will there be a switch to the LLVM C interface? -- Dan
Apr 24 2015
parent "Kai Nacke" <kai redstar.de> writes:
On Friday, 24 April 2015 at 15:33:36 UTC, Dan Olson wrote:
 Kai, Just curious.  When LDC moves to DDMD, is the plan to 
 continue to
 use the LLVM C++ interface, perhaps making the C++ glue layer 
 simple
 enough that D can handle properly, or will there be a switch to 
 the LLVM
 C interface?
Hi Dan! I think that the C interface of LLVM does not expose all the stuff LDC is using. We will end with having a C++ glue layer. This could also have a good side effect: we can try to encapsulate the API differences in the glue layer. Regards, Kai
Apr 26 2015