D scripting

EntangledQuanta via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 5 11:37:17 PDT 2017


On Tuesday, 5 September 2017 at 08:13:02 UTC, Andre Pany wrote:
> On Tuesday, 5 September 2017 at 07:32:24 UTC, EntangledQuanta 
> wrote:
>> I would like to use D as a "scripting" language for my D app. 
>> There seems to be no such thing.
>>
>> Since we can include the D compiler in our distribution, it is 
>> easy to enable "plugin" capabilities, but directly interfacing 
>> with the source code seems like it would require a bit of 
>> work(duplicating the code that one wants to include so it can 
>> be linked in and "hot swapping").
>
> Which OS do you use? I had a similiar idea but failed on 
> windows due to some strange effects. I think they were caused 
> by the known windows dll unload bug, discussed here: 
> http://forum.dlang.org/thread/rreyasqnvyagrkvqrjos@forum.dlang.org
>
> At the end I decided to use the script engine from Adam Ruppe 
> (arsd) until this bug is fixed.
>
> Kind regards
> André


Yes, windows ;/ Seems that thread has some answers! Maybe bug him 
enough to fix the bug?

How far did you get with it?

"The problem seems to only manifest when a proper DllMain() 
method is exported from the library.  If none is provided, or if 
the given implementation can be optimized away, the error does 
not ocurr."

Was that the case for you too? That could be overcome with just 
using a normal function that is called right after loading?

I'm curious how the exporting of code as that seems to be the 
biggest challenge(so that we don't have to hand write the exports 
ourselves).


Thanks.





More information about the Digitalmars-d-learn mailing list