Thread overview
How to reduce executable size
Jan 21, 2005
Anonymous
Jan 21, 2005
huang yicheng
Jan 21, 2005
Kris
January 21, 2005
Hi there,

Even the simplest D program "void main(){}" is compiled into 80+
kilobytes by dmd (win32) in release mode.
Is there some way to reduce the code size?

Thanks in advance.


January 21, 2005
maybe use some tools like upx?:)

Yicheng
"Anonymous" <Anonymous_member@pathlink.com> wrote in message
news:csraoo$9q9$1@digitaldaemon.com...
> Hi there,
>
> Even the simplest D program "void main(){}" is compiled into 80+
> kilobytes by dmd (win32) in release mode.
> Is there some way to reduce the code size?
>
> Thanks in advance.
>
>


January 21, 2005
Anonymous wrote:

> Even the simplest D program "void main(){}" is compiled into 80+
> kilobytes by dmd (win32) in release mode.
> Is there some way to reduce the code size?

The main reason a C++ program is smaller is that it uses a
dynamic run-time library. D uses a static "phobos" library.

If C++ is compiled with a static runtime as well, I find the
executables it generates to be a lot larger than the D ones ?

But C is still a lot smaller. Not that 80 KB is anything...

--anders

PS. Here are my sizes:

>  12K    hello_c
> 368K    hello_cpp
> 100K    hello_d
> 4.0K    hello.jar

For "Hello, World!"...
January 21, 2005
In article <csraoo$9q9$1@digitaldaemon.com>, Anonymous says...
>
>Hi there,
>
>Even the simplest D program "void main(){}" is compiled into 80+
>kilobytes by dmd (win32) in release mode.
>Is there some way to reduce the code size?
>
>Thanks in advance.
>
>

Yes; convince Walter to remove printf() from Object.d ... it drags along all the floating point library support, just for jollies.