Re: hello world in D

2013-06-01 Thread Paulo Pinto
Am 31.05.2013 19:21, schrieb Rob T: On Friday, 31 May 2013 at 16:52:53 UTC, Jonathan M Davis wrote: On Friday, May 31, 2013 18:05:16 Rob T wrote: I've seen this happen with 2.062, if you take out -noboundscheck it may reduce the size significantly and compile a lot faster. Makes no sense. My

Re: hello world in D

2013-06-01 Thread Paulo Pinto
Am 31.05.2013 19:19, schrieb deadalnix: On Friday, 31 May 2013 at 16:31:42 UTC, Regan Heath wrote: On Fri, 31 May 2013 16:58:11 +0100, Craig Dillabaugh cdill...@cg.scs.carleton.ca wrote: Under 40 kilobytes! If you do the bare minimum you can get down to about 1 KB, but at that point, you're

Re: hello world in D

2013-06-01 Thread SomeDude
On Friday, 31 May 2013 at 16:31:42 UTC, Regan Heath wrote: Do you really think that is such a big issue? Not really an issue, no. But newcomers keep creating threads like this one time and again and who knows how many have been turned away without finding out the whys and wherefores. R

Re: hello world in D

2013-06-01 Thread Rob T
On Friday, 31 May 2013 at 14:33:48 UTC, khurshid wrote: I just download dmd 2.063, and compile simple hello world program: // hello.d import std.stdio; int main() { writeln(hello world); return 0; } with -O -release -inline -noboundscheck flags. And size of result output file

hello world in D

2013-05-31 Thread khurshid
I just download dmd 2.063, and compile simple hello world program: // hello.d import std.stdio; int main() { writeln(hello world); return 0; } with -O -release -inline -noboundscheck flags. And size of result output file 'hello' equal to 1004.1 Kbyte !!! Why size is big? I'm

Re: hello world in D

2013-05-31 Thread Adam D. Ruppe
On Friday, 31 May 2013 at 14:33:48 UTC, khurshid wrote: And size of result output file 'hello' equal to 1004.1 Kbyte Whoa, that's up like several times from the last dmd release you can get down to 600 kb or so by not using the flags. Strange, combining all those flags increases the

Re: hello world in D

2013-05-31 Thread Regan Heath
On Fri, 31 May 2013 15:33:46 +0100, khurshid khurshid.normura...@gmail.com wrote: I just download dmd 2.063, and compile simple hello world program: // hello.d import std.stdio; int main() { writeln(hello world); return 0; } with -O -release -inline -noboundscheck flags. And

Re: hello world in D

2013-05-31 Thread khurshid
On Friday, 31 May 2013 at 14:48:02 UTC, Adam D. Ruppe wrote: If you use printf instead of std.stdio, you'll save about 150 KB in the executable import core.stdc.stdio; void main() { printf(hello\n); } $ dmd test2.d $ ls -lh test2 -rwxr-xr-x 1 me users 287K 2013-05-31 10:40 test2 $

Re: hello world in D

2013-05-31 Thread Adam D. Ruppe
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

Re: hello world in D

2013-05-31 Thread Regan Heath
On Fri, 31 May 2013 16:00:00 +0100, Adam D. Ruppe destructiona...@gmail.com wrote: 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

Re: hello world in D

2013-05-31 Thread Adam D. Ruppe
On Friday, 31 May 2013 at 14:56:17 UTC, khurshid wrote: i.e. 299 Kbyte. yeah it varies a bit by computer and 32 bit vs 64 bit etc, but same ballpark. Why copyright 2012 not a 2013? Walter probably just forgot to update the message.

Re: hello world in D

2013-05-31 Thread Adam D. Ruppe
On Friday, 31 May 2013 at 15:03:58 UTC, Regan Heath wrote: It is a bit surprising isn't it. Aye. BTW if you want to get into really small, statically linked D programs, you can do a custom druntime, no phobos, no C lib, with just the code you want. I recently wrote about a toy I've been

Re: hello world in D

2013-05-31 Thread Craig Dillabaugh
Under 40 kilobytes! If you do the bare minimum you can get down to about 1 KB, but at that point, you're actually writing in mostly (inline) assembly rather than D. The code in the link though supports a majority (though certainly not all) of D's features. Agreed 100%. But newcomers don't

Re: hello world in D

2013-05-31 Thread Rob T
I've seen this happen with 2.062, if you take out -noboundscheck it may reduce the size significantly and compile a lot faster. Makes no sense. --rt

Re: hello world in D

2013-05-31 Thread Adam D. Ruppe
On Friday, 31 May 2013 at 15:58:12 UTC, Craig Dillabaugh wrote: Do you really think that is such a big issue? I can't remember the last time I looked at the size of an executable I generated. There's three cases where I sometimes care: 1) if I build the program on my computer, then push it

Re: hello world in D

2013-05-31 Thread Brad Anderson
On Friday, 31 May 2013 at 14:56:17 UTC, khurshid wrote: [snip] Even, when I type dmd -v : DMD32 D Compiler v2.063 Copyright (c) 1999-2012 by Digital Mars written by Walter Bright Documentation: http://dlang.org/ - Why copyright 2012 not a 2013?

Re: hello world in D

2013-05-31 Thread Regan Heath
On Fri, 31 May 2013 16:58:11 +0100, Craig Dillabaugh cdill...@cg.scs.carleton.ca wrote: Under 40 kilobytes! If you do the bare minimum you can get down to about 1 KB, but at that point, you're actually writing in mostly (inline) assembly rather than D. The code in the link though

Re: hello world in D

2013-05-31 Thread Joseph Rushton Wakeling
On 05/31/2013 06:34 PM, Brad Anderson wrote: On Friday, 31 May 2013 at 14:56:17 UTC, khurshid wrote: Why copyright 2012 not a 2013? Fixed in git. Is this not something where some clever CTFE could be used to swipe the date of build and insert the correct year? :-P

Re: hello world in D

2013-05-31 Thread Jonathan M Davis
On Friday, May 31, 2013 18:05:16 Rob T wrote: I've seen this happen with 2.062, if you take out -noboundscheck it may reduce the size significantly and compile a lot faster. Makes no sense. My first guess would be that more ends up being inlined with -noboundscheck due to the differences in

Re: hello world in D

2013-05-31 Thread Andrei Alexandrescu
On 5/31/13 12:48 PM, Joseph Rushton Wakeling wrote: On 05/31/2013 06:34 PM, Brad Anderson wrote: On Friday, 31 May 2013 at 14:56:17 UTC, khurshid wrote: Why copyright 2012 not a 2013? Fixed in git. Is this not something where some clever CTFE could be used to swipe the date of build and

Re: hello world in D

2013-05-31 Thread deadalnix
On Friday, 31 May 2013 at 16:31:42 UTC, Regan Heath wrote: On Fri, 31 May 2013 16:58:11 +0100, Craig Dillabaugh cdill...@cg.scs.carleton.ca wrote: Under 40 kilobytes! If you do the bare minimum you can get down to about 1 KB, but at that point, you're actually writing in mostly (inline)

Re: hello world in D

2013-05-31 Thread Rob T
On Friday, 31 May 2013 at 16:52:53 UTC, Jonathan M Davis wrote: On Friday, May 31, 2013 18:05:16 Rob T wrote: I've seen this happen with 2.062, if you take out -noboundscheck it may reduce the size significantly and compile a lot faster. Makes no sense. My first guess would be that more ends

Re: hello world in D

2013-05-31 Thread Marco Leise
Am Fri, 31 May 2013 17:58:11 +0200 schrieb Craig Dillabaugh cdill...@cg.scs.carleton.ca: Do you really think that is such a big issue? I can't remember the last time I looked at the size of an executable I generated. When I am trying to learn a new language it is really not something I think

Re: hello world in D

2013-05-31 Thread Marco Leise
Am Fri, 31 May 2013 13:14:48 -0400 schrieb Andrei Alexandrescu seewebsiteforem...@erdani.org: On 5/31/13 12:48 PM, Joseph Rushton Wakeling wrote: On 05/31/2013 06:34 PM, Brad Anderson wrote: On Friday, 31 May 2013 at 14:56:17 UTC, khurshid wrote: Why copyright 2012 not a 2013? Fixed