Pragma mangle and D shared objects

Etienne Cimon via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Oct 25 09:15:19 PDT 2014


On 2014-10-25 11:56, Etienne Cimon wrote:
> That looks like exactly the solution I need, very clever. It'll take
> some time to wrap my head around it :-P

Just brainstorming here, but I think every dynamic library should hold a 
utility container (hash map?) that searches for and returns the mangled 
names in itself using regex match. This container would always be in the 
same module/function name in every dynamic library.

The mangling list would load itself using introspection through a 
`shared static this()`. For each module, for each class, insert mangling 
in the hashmap...

This seems ideal because then you basically have libraries that document 
themselves at runtime.

Of course, the return type and arguments would have to be decided in 
advance, but otherwise it allows loading and use of (possibly remote and 
unknown) DLLs, in a very simple way.


More information about the Digitalmars-d-learn mailing list