www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dmd as a library for scripting/JIT?

reply dennis luehring <dl.soluz gmx.net> writes:
i've got user defined flow charts in my C++ application that calling 
C/C++ Code - could be possible to embedd dmd as a library, generate D 
code out of my flow charts and execute the "compiled" code directly 
without doing file io or dmd.exe runs to create dlls that i hot reload?
Sep 14 2018
next sibling parent Neia Neutuladh <neia ikeran.org> writes:
On Friday, 14 September 2018 at 16:02:36 UTC, dennis luehring 
wrote:
 i've got user defined flow charts in my C++ application that 
 calling C/C++ Code - could be possible to embedd dmd as a 
 library, generate D code out of my flow charts and execute the 
 "compiled" code directly without doing file io or dmd.exe runs 
 to create dlls that i hot reload?
You could potentially embed LDC and LLVM as a library to do that. I don't think it's set up to emit LLVM IR in-memory at the moment, though.
Sep 14 2018
prev sibling parent Stefan Koch <uplink.coder googlemail.com> writes:
On Friday, 14 September 2018 at 16:02:36 UTC, dennis luehring 
wrote:
 i've got user defined flow charts in my C++ application that 
 calling C/C++ Code - could be possible to embedd dmd as a 
 library, generate D code out of my flow charts and execute the 
 "compiled" code directly without doing file io or dmd.exe runs 
 to create dlls that i hot reload?
DMD is currently not reenterant. You have better chances using libtcc [1] for such a purpose. Cheers, Stefan [1] http://download.savannah.gnu.org/releases/tinycc/tcc-0.9.27.tar.bz2
Sep 14 2018