Program size, linking matter, and static this()

Sean Kelly sean at invisibleduck.org
Fri Dec 16 15:10:37 PST 2011


On Dec 16, 2011, at 1:45 PM, Andrei Alexandrescu wrote:

> On 12/16/11 3:38 PM, Trass3r wrote:
>> A related issue is phobos being an intermodule dependency monster.
>> A simple hello world pulls in almost 30 modules!
>> And std.stdio is supposed to be just a simple wrapper around C FILE.
> 
> In fact it doesn't (after yesterday's commit). The std code in hello, world is a minuscule 3KB. The rest of 218KB is runtime.

Once upon a time, a minimal D app was roughly 65K.  TypeInfo has ballooned a lot since then however.  It's worth considering whether you're writing a Windows or Posix app as well, since the Posix headers are far more extensive (and thus may result in far more ModuleInfo instances).


More information about the Digitalmars-d mailing list