Thoughts about D

Steven Schveighoffer schveiguy at yahoo.com
Thu Nov 30 02:54:19 UTC 2017


On 11/29/17 9:16 PM, Walter Bright wrote:
> On 11/29/2017 3:36 PM, Jon Degenhardt wrote:
>> On Wednesday, 29 November 2017 at 16:57:36 UTC, H. S. Teoh wrote:
>>> While generally I would still use fullblown D rather than BetterC for 
>>> my projects, the bloat from druntime/phobos does still bother me at 
>>> the back of my mind.  IIRC, the Phobos docs used to state that the 
>>> philosophy for Phobos is pay-as-you-go. As in, if you don't use 
>>> feature X, the code and associated data that implements feature X 
>>> shouldn't even appear in the executable. It seems that we have fallen 
>>> away from that for a while now.  Perhaps it's time to move D back in 
>>> that direction.
>>
>> If there specific apps where druntime and/or phobos bloat is thought 
>> to be too high, it might be worth trying the new LDC support for 
>> building a binary with druntime and phobos compiled with LTO (Link 
>> Time Optimization). I saw reduced binary sizes on my apps, it'd be 
>> interesting to hear other experiences.
> 
> Ideally, the druntime library should be come with the operating system 
> so every user has a copy of it. Practically, I can't see that happening 
> for the foreseeable future. It doesn't even happen for Windows with 
> Microsoft's own compiler.

But even though it doesn't come with Windows, it can be installed once, 
and shared between all applications that use it.

The issue with druntime isn't that it's not installed, it's the static 
linking.

A second problem is that due to the way D works most of the time (with 
templates just about everywhere), each new release is likely to be 
binary-incompatible. So you will essentially need many copies of 
druntime, probably one per release that was used to compile any D 
programs on your system. But this is much less of an issue, especially 
if there are many programs that build using the same release.

-Steve


More information about the Digitalmars-d mailing list