std.plugin ?

FreeSlave freeslave93 at gmail.com
Tue Oct 1 12:17:10 PDT 2013


On Tuesday, 1 October 2013 at 18:00:34 UTC, Jacob Carlborg wrote:
> On 2013-10-01 13:36, FreeSlave wrote:
>
>> I just checked it on Linux. ClassInfo.find can't find the 
>> class from
>> shared library. That's what I did:
>
> Dynamic libraries are not completely implemented yet in D. I 
> expect this to work when the implementation is complete.
>
> BTW, which version are you using. git HEAD has some new 
> functionality in this area.

Now I also did this on Windows using Runtime.loadLibrary instead 
of dlopen, but result is same. I have 2.062 on Linux and 2.063 on 
Windows. Ok, I need to update to check out the actual status.

Even if it would be possible to create instances of classes using 
ClassInfo, I still think phobos needs module to load functions at 
runtime. Especially it concerns functions with mangled names 
(i.e. all extern(D) functions). C++ frameworks usually deal only 
with extern "C" functions because C++ mangling is not 
standardized and therefore it depends on current compiler. D 
however can provide same rules for all compilers. In my project 
I've implemented 'mangle' function by hand but I have not 
properly test it yet. Well, D has .mangleof but it's compiletime 
only. We need official runtime version that allows to write 
things like:

auto func = lib.getDFunction!FunctionType 
("package_name.module_name.function_name");


More information about the Digitalmars-d mailing list