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.


But you should compare this to other common programming language's sizes:

* Java programs need the user to download like 20 MB of the JRE to run

* Ditto for the .net/mono frameworks

* The ruby interpreter on my computer is about 18 MB

* etc etc etc


Compared to them, D programs are small. The big difference is Java, .net, ruby, python, etc. are already popular enough to have their libraries/support code pre-installed on the user's computer. D programs, on the other hand, carry all their support code with them in each executable (they're statically linked) so they have better odds of just working without the user needing to install other stuff that they prolly don't already have.

Reply via email to