September 02, 2014
On 2 September 2014 01:03, David Nadlinger via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> On Monday, 1 September 2014 at 22:17:13 UTC, Abe wrote:
>>
>> Do you guys — or anybody else — know what the situation is with GDC?  Does
>> it strip out unneeded sections/symbols/both, or is it just dumping
>> everything into the executable like DMD-on-Mac-OS-X seems to do?
>
>
> GDC does not strip unneeded stuff by default on any OS, and generates by far the biggest executables in my experience (though some of it is due to druntime/Phobos debug info which you can manually strip out afterwards).
>

make install-strip !

Though I'd imagine that libgcc is likely one of the main contributors to the notably stouter application size vs dmd/ldc.  Someone should actually study where the symbols come from.

Iain.

September 05, 2014
Am Tue, 02 Sep 2014 07:03:52 +0000
schrieb "Dicebot" <public@dicebot.lv>:

> On Tuesday, 2 September 2014 at 06:18:27 UTC, Jacob Carlborg wrote:
> > On 01/09/14 20:33, Dicebot wrote:
> >
> >> Any reason why it can't work for OSX in a same way? Assuming
> >> LDC does
> >> emit ModuleInfo & Co sections the same way it does on Linux,
> >> using OSX
> >> specific alternative to --gc-sections should "just work".
> >
> > It does not emit these sections the same way, at least not on DMD.
> 
> Well I am speaking about LDC ;) --gc-sections don't work with Linux DMD either.

Hey, every new release I go and try it, but found that dub will still crash when linked with --gc-sections, so some symbols need to be "added as GC roots".

That said with -defaultlib=phobos2 (picking up the .so
version) the file size is:

                   48 KiB  !!!

after `strip main` it comes down to:

                   34 KiB  !!!

Only when you think about how people put 5 minutes of a stunning 3D gfx demo into 64 KiB you start to worry about 34 KiB for "Hello World!" again.

-- 
Marco

September 05, 2014
On Friday, 5 September 2014 at 09:27:41 UTC, Marco Leise wrote:
> Only when you think about how people put 5 minutes of a
> stunning 3D gfx demo into 64 KiB you start to worry about 34
> KiB for "Hello World!" again.

You meant 4KiB…

https://www.youtube.com/watch?v=RCh3Q08HMfs&list=PLA5E2FF8E143DA58C
September 05, 2014
On Friday, 5 September 2014 at 11:50:37 UTC, Ola Fosheim Grøstad
wrote:
> On Friday, 5 September 2014 at 09:27:41 UTC, Marco Leise wrote:
>> Only when you think about how people put 5 minutes of a
>> stunning 3D gfx demo into 64 KiB you start to worry about 34
>> KiB for "Hello World!" again.
>
> You meant 4KiB…
>
> https://www.youtube.com/watch?v=RCh3Q08HMfs&list=PLA5E2FF8E143DA58C

That is beyond sanity...

I love it.
September 05, 2014
On Friday, 5 September 2014 at 09:27:41 UTC, Marco Leise wrote:
> Am Tue, 02 Sep 2014 07:03:52 +0000
> schrieb "Dicebot" <public@dicebot.lv>:
> Only when you think about how people put 5 minutes of a
> stunning 3D gfx demo into 64 KiB you start to worry about 34
> KiB for "Hello World!" again.

This made my day.

Anyways yea, i tried using LDC and --gc-sections as lflags in dub
but i cant get dub to play nice with LDC. I think Dub just uses
DMD be default and cannot be changed, im not sure.
September 05, 2014
Am Fri, 05 Sep 2014 19:38:13 +0000
schrieb "deadalnix" <deadalnix@gmail.com>:

> On Friday, 5 September 2014 at 11:50:37 UTC, Ola Fosheim Grøstad wrote:
> > On Friday, 5 September 2014 at 09:27:41 UTC, Marco Leise wrote:
> >> Only when you think about how people put 5 minutes of a stunning 3D gfx demo into 64 KiB you start to worry about 34 KiB for "Hello World!" again.
> >
> > You meant 4KiB…
> >
> > https://www.youtube.com/watch?v=RCh3Q08HMfs&list=PLA5E2FF8E143DA58C
> 
> That is beyond sanity...
> 
> I love it.

Me too... This is the Matrix. Mesmerizing.
Of course printing 12 characters to stdout is still much more
involved than even 5 of those ... demos ... with their graphics
shaders, metaballs, fish eye effects, camera fly throughs and
polyphonic synthesizer music.

-- 
Marco

September 05, 2014
On Monday, 1 September 2014 at 00:19:43 UTC, Adam D. Ruppe wrote:
> On Monday, 1 September 2014 at 00:10:25 UTC, Abe wrote:
>> Is this roughly the same on all relevant platforms for DMD?
>
> Yeah. If you used printf instead of writeln, the size gets down to about 250K (on my linux anyway), which can then be stripped down to 160K, showing that the rest of the size comes from pulling in a lot of standard library code.
>
> The rest of that 160 K is the druntime library, stuff like thread support, memory management, etc. that is always present.
>
> It is possible to strip that out too and make really tiny executables (I've gone down to under 3KB before playing with this, as have other people working in the embedded space), but then you don't get any of the library and it is easier said than done.

It used to be that a "hello world" D app using printf ran about
65K.  At some point, a lot of bloat appeared in the form of a
ModuleInfo object for each imported module, and these objects
themselves grew in size for reasons I can't recall.  That bloat
has since been trimmed down, but I believe there's still work to
be done there.
September 06, 2014
On 8/31/14, 8:51 PM, Abe wrote:
> Please note: 502064 bytes!!!  [for the curious: 490.296875
> kilobytes]

The real question is: why does size matter for you?

A simple "hello world" program in Go is 2 megabytes. That's four times the size in D. I don't know if people complain about that.

I efficiency matters most.
September 06, 2014
On Saturday, 6 September 2014 at 00:03:02 UTC, Ary Borenszweig wrote:
> The real question is: why does size matter for you?
>

I've been told that it does...
September 06, 2014
On Saturday, 6 September 2014 at 00:03:02 UTC, Ary Borenszweig wrote:
> The real question is: why does size matter for you?

1. download size for PNaCL/asm.js
2. ease of low level debugging/transparency
3. potential cache pollution
4. embedded programming / SoCs
5. bloat signals loss of control over the design
6. programer aesthetics