Modern C++ Lamentations

Rubn where at is.this
Tue Jan 1 20:59:25 UTC 2019


On Tuesday, 1 January 2019 at 19:28:36 UTC, Jonathan M Davis 
wrote:
> On Tuesday, January 1, 2019 7:04:42 AM MST Rubn via 
> Digitalmars-d wrote:
>> On Tuesday, 1 January 2019 at 11:57:26 UTC, kinke wrote:
>> > On Tuesday, 1 January 2019 at 09:44:40 UTC, Jacob Carlborg
>> >
>> > wrote:
>> >> On 2018-12-31 16:51, H. S. Teoh wrote:
>> >>> Note the order of magnitude difference in size, and that 
>> >>> ldc2
>> >>> achieves
>> >>> this by default, with no additional options needed.
>> >>>
>> >>> How do you make dmd produce the same (or comparable) 
>> >>> output?
>> >>
>> >> For me I get comparable output with DMD and LDC
>> >
>> > You guys are most likely comparing apples to oranges - H. S. 
>> > using some distro-LDC preconfigured to link against shared 
>> > druntime/Phobos, while LDC usually defaults to the static 
>> > libs.
>>
>> Druntime and Phobos can be used as shared libraries? What is 
>> this magical feature?
>>
>> -Windows User
>
> LOL. Personally, it's a feature that I avoid like the plague, 
> because I hate it when my programs stop working just because I 
> updated dmd (which would be bad enough for a normal user, but 
> it's particularly nasty when you're frequently following master 
> and making local changes, because you're working on Phobos, 
> druntime, and/or dmd). But yeah, when I saw the difference in 
> size that H.S. Teoh was seeing, my first thought was that one 
> was probably using Phobos as a shared library while the other 
> was using it as a static one.
>
> - Jonathan M Davis

On linux the version should be part of the filename, and iirc 
it'll only try the shared library without a version if it can't 
find the one it needs. Not too familiar with how it is done on 
Windows as it isn't really standardized. Could just look at how 
it is done for the C++ runtime, as I usually have 20 different 
versions of it installed even for the same MSVC year revision. I 
just stick the dll in the same folder as the executable.

I'd rather have a single shared library than having 20 instances 
of it loaded in my 20 dll files.

I can dream though, that one day this fundamental feature will be 
added to D.




More information about the Digitalmars-d mailing list