hello world in D

Adam D. Ruppe destructionator at gmail.com
Fri May 31 08:00:00 PDT 2013


On Friday, 31 May 2013 at 14:48:12 UTC, Regan Heath wrote:
> You  will get a similar size (or greater) if you statically 
> link the stdc library.

That's not necessarily true because static linking only pulls 
functions that are actually used by the program....

even though I just tried gcc hello.c -static, and got a beefy 600 
KB binary out of it, so maybe it is more intertwined than I 
thought!

> Eventually D will support dynamically linking to Phobos.

I think it is worth remembering that this doesn't actually reduce 
the size. In fact, it will increase it since the dynamic linked 
library needs all functions. The phobos.dll will be probably two 
or three megabytes, and if you are distributing a D app, you'll 
still have to offer that file... and now have the hassle of 
dependency management.

Dynamic linking might look less scary when your ls sees 20 KB 
instead of 600 but it doesn't really change anything substantial.


More information about the Digitalmars-d mailing list