Big executable?

Jacob Carlborg doob at me.com
Wed Oct 6 00:40:11 PDT 2010


On 2010-10-06 08:12, Andre Tampubolon wrote:
> Hi,
>
> I just started learning D (my background is C, anyway).
>
> I compiled this simple code using DMD 2.049 (dmd -O -release test1.d) :
> import std.stdio;
>
> void main()
> {
> writefln("%s World", "Hello");
> }
>
> The final executable size is about 300 KB. Isn't that a bit huge,
> considering the same code compiled using C or Pascal compiler will give
> smaller executable? So I tried to look at the *.map, and apparently the
> D runtime pulls a lot of stuff. I am just wondering, anyway.

You are aware of that C is (almost always) dynamically linked with the 
standard and runtime library but D (usually) is not? Using D1 and Tango 
on Mac OS X (which supports dynamic linking of the standard library) 
gives an executable of the size 16 KB if I recall correctly.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list