Problem with coupling shared object symbol visibility with protection

Benjamin Thaut via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 26 22:44:17 PST 2015


Am 26.01.2015 um 23:24 schrieb Walter Bright:
>
> exporting a template and then having the user instantiate outside of the
> library doesn't make a whole lot of sense, because the instantiation
> won't be there in the library. The library will have to instantiate
> every use case. If the compiler knows the library instantiated it, it
> won't re-instantiate it locally.

Sorry, but wtf? So we just throw all of phobos away? Given this argument 
you can _never_ make phobos into a shared lirary becuse you can't 
possibliy pre-instaniate all possible template permutations in phobos. 
Your suggestion is completely un-pratical. Even C++ allows you to 
instanciate templates provided by a shared library.

>
> I'd be thinking that what a shared library exports is fixed, and
> expecting the user to make more instantiations makes for a fairly
> unresolvable issue. The solution is design the templates to be expanded
> only on one side of the dll/exe boundary, not straddle it.
>

Again this just makes it impossible to make phobos ever work as a shared 
library. A Language as template heavy as D should clearly allow users to 
instanciate templates across dll/exe boundaries.

Why am I getting the impression, everytime I read one of your comments 
regarding dlls on windows, that you don't want them to be useable? DO 
you have a special hate against Windows or their shared library solution?

Kind Regards
Benjamin Thaut



More information about the Digitalmars-d mailing list