August 03, 2014
On Sunday, 3 August 2014 at 15:30:52 UTC, Dicebot wrote:
> For this simple program:
>
> ```
> import std.stdio, std.algorithm;
>
> void main()
> {
>     auto arr = [ 1, 2, 3, 4 ];
>     writeln(arr.map!(a => 2*a));
> }
> ```
>
> -rwxr-xr-x  1 dicebot users 581K Aug  3 16:52 dmd
> -rwxr-xr-x  1 dicebot users 3.6M Aug  3 17:24 gdc
> -rwxr-xr-x  1 dicebot users 2.2M Aug  3 16:54 ldc-old
> -rwxr-xr-x  1 dicebot users 410K Aug  3 17:21 ldc-new
>
> It is quite interesting that dmd binary size is so smaller than gdc and old ldc output - probably something related to frontend symbol emitting difference. I have also checked `nm -a` output and can confirmed that `ldc-new` is the only one that does not have inlined map symbols (including lambda) in the resulting binary.
>
> output for stripped binaries:
>
> -rwxr-xr-x  1 dicebot users 387K Aug  3 17:27 dmd
> -rwxr-xr-x  1 dicebot users 2.6M Aug  3 17:27 gdc
> -rwxr-xr-x  1 dicebot users 1.1M Aug  3 17:27 ldc-old
> -rwxr-xr-x  1 dicebot users 274K Aug  3 17:27 ldc-new
>
> compiling small vibe.d application that uses Diet templates:
>
> -rwxr-xr-x 1 dicebot users  16M Aug  3 17:30 diet-dmd
> -rwxr-xr-x 1 dicebot users 8.2M Aug  3 17:31 diet-ldc-new
It's on Linux x64?
I'm on Windows x64,not use any Options ,the size is 3112kb,the old's exe size was 3394kb,it's smaller,but why so big on windows x64?
Thank you.
Frank

August 03, 2014
On Sunday, 3 August 2014 at 23:07:22 UTC, FrankLike wrote:
> On Sunday, 3 August 2014 at 15:30:52 UTC, Dicebot wrote:
>> For this simple program:
>>
>> ```
>> import std.stdio, std.algorithm;
>>
>> void main()
>> {
>>    auto arr = [ 1, 2, 3, 4 ];
>>    writeln(arr.map!(a => 2*a));
>> }
>> ```
>>
>> -rwxr-xr-x  1 dicebot users 581K Aug  3 16:52 dmd
>> -rwxr-xr-x  1 dicebot users 3.6M Aug  3 17:24 gdc
>> -rwxr-xr-x  1 dicebot users 2.2M Aug  3 16:54 ldc-old
>> -rwxr-xr-x  1 dicebot users 410K Aug  3 17:21 ldc-new
>>
>> It is quite interesting that dmd binary size is so smaller than gdc and old ldc output - probably something related to frontend symbol emitting difference. I have also checked `nm -a` output and can confirmed that `ldc-new` is the only one that does not have inlined map symbols (including lambda) in the resulting binary.
>>
>> output for stripped binaries:
>>
>> -rwxr-xr-x  1 dicebot users 387K Aug  3 17:27 dmd
>> -rwxr-xr-x  1 dicebot users 2.6M Aug  3 17:27 gdc
>> -rwxr-xr-x  1 dicebot users 1.1M Aug  3 17:27 ldc-old
>> -rwxr-xr-x  1 dicebot users 274K Aug  3 17:27 ldc-new

 What Optins you know on Windows x64 ? I want let the exe file to small.
  Thank you.
  Frank

August 03, 2014
On 3 Aug 2014, at 17:36, Dicebot via digitalmars-d-ldc wrote:
> P.S. I have noticed that now libdruntime.a is not included into libphobos2.a and needs to be package too, is it intended or just unforeseen side effect of shared library support?

This is an intended change. Let me elaborate a bit:

The linking behavior was indeed changed while introducing shared library support, as it is more or less the natural thing to do for shared libraries (some programs might only depend on druntime, and there should be only one copy of it. I could have left the way static libraries are built unchanged, but that would have required more logic for setting up the config files appropriately and so on. Additionally, we were actually building the object files twice before, so the build system internals for the static case needed a revision anyway.

In short, it probably doesn't make a lot of difference either way, but the split version seems a bit nicer conceptually and simplifies the build system a bit. If there is a good reason to revert to the previous version, this could definitely be done (although I probably won't have the time to do the changes until end of August).

This should definitely be mentioned in the release notes, though (the library name also changed to phobos2-ldc instead of phobos-ldc so as to avoid any transitioning problems).

Cheers,
David
August 03, 2014
On 3 Aug 2014, at 17:30, Dicebot via digitalmars-d-ldc wrote:
> It is quite interesting that dmd binary size is so smaller than gdc and old ldc output - probably something related to frontend symbol emitting difference.

This might be part of the reason. The much bigger cause is probably the fact that DMD emits each function (?) into a separate object file when building with -lib, whereas LDC emits one object file per module. This trick in DMD allows the linker to skip more of the unused symbols even without --gc-sections.

Cheers,
David
August 03, 2014
On Sunday, 3 August 2014 at 23:07:22 UTC, FrankLike wrote:
> It's on Linux x64?
> I'm on Windows x64,not use any Options ,the size is 3112kb,the old's exe size was 3394kb,it's smaller,but why so big on windows x64?
> Thank you.
> Frank

It is Arch Linux x86_64, I don't use Windows.
August 03, 2014
On Sunday, 3 August 2014 at 23:37:55 UTC, David Nadlinger via digitalmars-d-ldc wrote:
> On 3 Aug 2014, at 17:36, Dicebot via digitalmars-d-ldc wrote:
>> P.S. I have noticed that now libdruntime.a is not included into libphobos2.a and needs to be package too, is it intended or just unforeseen side effect of shared library support?
>
> This is an intended change. Let me elaborate a bit:
>
> The linking behavior was indeed changed while introducing shared library support, as it is more or less the natural thing to do for shared libraries (some programs might only depend on druntime, and there should be only one copy of it. I could have left the way static libraries are built unchanged, but that would have required more logic for setting up the config files appropriately and so on. Additionally, we were actually building the object files twice before, so the build system internals for the static case needed a revision anyway.
>
> In short, it probably doesn't make a lot of difference either way, but the split version seems a bit nicer conceptually and simplifies the build system a bit. If there is a good reason to revert to the previous version, this could definitely be done (although I probably won't have the time to do the changes until end of August).
>
> This should definitely be mentioned in the release notes, though (the library name also changed to phobos2-ldc instead of phobos-ldc so as to avoid any transitioning problems).
>
> Cheers,
> David

No problem, it took me only few minutes to figure out the changes and update the  packaging script. Just wanted to make sure it is known and intended change.
August 04, 2014
 Kai Nacke
> 5e379188d9d366423caa69d948c11772 ldc2-0.14.0-alpha1-mingw-x86.7z
> c2bbbd9595208ee3afe05253c40a84d0 ldc2-0.14.0-alpha1-mingw-x86.zip

On Windows x64,a helloworld.exe's size is 3113kb. very big .

Maybe Win64/MSVC package is ok?

Thank you.
Frank
August 05, 2014
> On Windows x64,a helloworld.exe's size is 3113kb. very big .
>
> Maybe Win64/MSVC package is ok?

1.2MB, I suspect the unfinished uwtables implementation.

Here's a test version:
https://github.com/Trass3r/ldc/releases/download/v0.14.0-alpha1/ldc.7z
August 05, 2014
On Sunday, 3 August 2014 at 23:47:29 UTC, Dicebot wrote:
> On Sunday, 3 August 2014 at 23:37:55 UTC, David Nadlinger via digitalmars-d-ldc wrote:
>> On 3 Aug 2014, at 17:36, Dicebot via digitalmars-d-ldc wrote:
>>> P.S. I have noticed that now libdruntime.a is not included into libphobos2.a and needs to be package too, is it intended or just unforeseen side effect of shared library support?
>>
>> This is an intended change. Let me elaborate a bit:
>>
>> The linking behavior was indeed changed while introducing shared library support, as it is more or less the natural thing to do for shared libraries (some programs might only depend on druntime, and there should be only one copy of it. I could have left the way static libraries are built unchanged, but that would have required more logic for setting up the config files appropriately and so on. Additionally, we were actually building the object files twice before, so the build system internals for the static case needed a revision anyway.
>>
>> In short, it probably doesn't make a lot of difference either way, but the split version seems a bit nicer conceptually and simplifies the build system a bit. If there is a good reason to revert to the previous version, this could definitely be done (although I probably won't have the time to do the changes until end of August).
>>
>> This should definitely be mentioned in the release notes, though (the library name also changed to phobos2-ldc instead of phobos-ldc so as to avoid any transitioning problems).
>>
>> Cheers,
>> David
>
> No problem, it took me only few minutes to figure out the changes and update the  packaging script. Just wanted to make sure it is known and intended change.

Have you considered creating dlang-*-prerelease/latest packages? It would be nice to be able to grab these alphas/betas/rcs through the arch repos or the AUR.
If they defaulted to the latest release when there isn't any pre-release available that would be even better.
August 05, 2014
On Tuesday, 5 August 2014 at 13:02:49 UTC, Trass3r wrote:
>> On Windows x64,a helloworld.exe's size is 3113kb. very big .
>>
>> Maybe Win64/MSVC package is ok?
>
> 1.2MB, I suspect the unfinished uwtables implementation.
>
> Here's a test version:
> https://github.com/Trass3r/ldc/releases/download/v0.14.0-alpha1/ldc.7z

Yes,Now it's 1248kb.but on ldc0.12.1, it's only 319kb.

Thank you .

Frank.