dynamically compile and load glue logic

rikki cattermole rikki at cattermole.co.nz
Fri Mar 30 14:40:50 UTC 2018


On 31/03/2018 3:38 AM, H. S. Teoh wrote:
> On Fri, Mar 30, 2018 at 02:24:45PM +0000, yawniek via Digitalmars-d-learn wrote:
>> in how far is it or would the following be possible:
>>
>> dynamically compile and execute some glue logic that is also written
>> in D under linux?
>>
>> and what happens if that code uses phobos or other dub libs that are
>> available in the host binary?
> [...]
> 
> I've written a program where user input drives the generation of a code
> snippet that then gets passed to an invocation of dmd, compiled, linked
> and the loaded as a shared library via dlopen(), et al. It works fairly
> well, and dmd generally is fast enough that the pause is not very
> noticeable. (This was before dmd-as-a-library was available; I imagine
> it would be even faster today now that you don't have to spawn a
> separate dmd process.)

Still need to, front end is barely alpha.
Can't be reset for example (last I checked, but doubt that has changed).


More information about the Digitalmars-d-learn mailing list