Re: Compiler: Size of generated executable file

2010-01-10 Thread retard
Sun, 10 Jan 2010 13:05:12 -0800, Walter Bright wrote: > grauzone wrote: >> Walter Bright wrote: >>> What's hard about "function foo is in the executable, and consumes 421 >>> bytes"? >> >> If an executable has > 1 symbols, it's hard to find out what's >> actually causing overhead. If you have

Re: No D in Great Computer Language Shootout?

2010-01-10 Thread retard
Sun, 10 Jan 2010 21:36:20 -0500, Isaac Gouy wrote: > > It seems like you want measurements for bleeding edge versions and a > bunch of languages that are interesting to you - but you can't be > bothered making those measurements yourself. I'm interested in the bleeding edge versions of all langu

Re: Compiler: Size of generated executable file

2010-01-10 Thread bearophile
Sean Kelly: > I guess this is different than --gc-sections or whatever the ld flag is?< I don't remember what --gc-sections is, but I guess it's something different. The code removed during the LTO is for example unreachable functions, or functions/methods, that once inlined are called from nowh

Re: Help with demangling

2010-01-10 Thread g
g Wrote: > Hi > Is there a way to demangle .mangleof strings at CTFE > or at least know the fully qualified name of a class or template instance. let's repeat : "Google is your friend!" http://www.dsource.org/projects/ddl/browser/trunk/meta/demangle.d but is severely outdated (dmd 0.166! btw im u

Help with demangling

2010-01-10 Thread g
Hi Is there a way to demangle .mangleof strings at CTFE or at least know the fully qualified name of a class or template instance.

Re: No D in Great Computer Language Shootout?

2010-01-10 Thread Isaac Gouy
retard Wrote: > Sat, 26 Dec 2009 20:27:43 +, Isaac Gouy wrote: > > > Thu, 17 Dec 2009 retard wrote > > > >> My point was that the language shootout has a lot more publicity than > >> some 3rd party mini benchmark site. Almost everyone knows the site. > > > > That isn't accidental. > > > >

Re: Compiler: Size of generated executable file

2010-01-10 Thread Sean Kelly
bearophile Wrote: > Currently Link Time Optimization of LLVM (that can be used by LDC) removes > some unused code from D1 programs. I guess this is different than --gc-sections or whatever the ld flag is? I recall that one breaking exception handling, though I also recall there being a trivia

Identity assignment operator overload LEGAL for const, etc.

2010-01-10 Thread Tomek SowiƄski
This rightfully doesn't compile: class A { A opAssign(A a); // Error: function test.A.opAssign identity assignment operator overload is illegal } But when instead of A you assign const(A), shared(A) or any_type_constructor(A) it compiles. Is this intended? Tomek

Re: Compiler: Size of generated executable file

2010-01-10 Thread retard
Sun, 10 Jan 2010 16:45:56 -0500, bearophile wrote: > Chris: >> Execution speed perhaps, since the time elapsed is proportional to the >> number of processor instruction executed. This explains why some people >> (for certain time critical apps) do not even take the step from C to >> C++, and chose

Re: Compiler: Size of generated executable file

2010-01-10 Thread bearophile
Chris: > Execution speed perhaps, since the time elapsed is proportional to the > number of processor instruction executed. This explains why some people > (for certain time critical apps) do not even take the step from C to C++, > and chose to stay 20 year behind "modern" languages. In real progr

Re: Compiler: Size of generated executable file

2010-01-10 Thread Walter Bright
Chris wrote: I simply can't get used to it, and probably never will for anyone who used to code in low-level languages, since they know how much a program size can really be. I downloaded a program from cpuid.com to tell me what processor I'm running. The executable file size is 1.8 Mb.

Re: Compiler: Size of generated executable file

2010-01-10 Thread Walter Bright
grauzone wrote: Walter Bright wrote: What's hard about "function foo is in the executable, and consumes 421 bytes"? If an executable has > 1 symbols, it's hard to find out what's actually causing overhead. If you have a script, that categorizes symbol types by demangling the symbol names

Re: Compiler: Size of generated executable file

2010-01-10 Thread grauzone
Nick Sabalausky wrote: I'd rather use an app that did a bunch of compile-time reflection than one that did a bunch of run-time reflection. And I think that 50..100 MB figure The question is: what will cause more overhead? Compile time or runtime reflection? For some use cases, you'll have com

Re: Compiler: Size of generated executable file

2010-01-10 Thread grauzone
Walter Bright wrote: grauzone wrote: Walter Bright wrote: grauzone wrote: (The final executable is almost twice the size as the D2 one too, although it's questionable how much of the additional size is due to templates.) Finding out why an executable is large is as easy as compiling with -

Re: Compiler: Size of generated executable file

2010-01-10 Thread Walter Bright
grauzone wrote: Walter Bright wrote: grauzone wrote: (The final executable is almost twice the size as the D2 one too, although it's questionable how much of the additional size is due to templates.) Finding out why an executable is large is as easy as compiling with -L/map on Windows and -

Re: Compiler: Size of generated executable file

2010-01-10 Thread Sean Kelly
Ph Wrote: > Why a generated file is so huge? > "Empty" program such as: > > int main(char[][] args) > { > > return 0; > } > > compiled with dmd2 into file with size of 266268 bytes. > Even after UPX, it's size is 87552 bytes. > Size of this code,compiled with VS(yes,yes, C++), is 6 656 b

Re: Compiler: Size of generated executable file

2010-01-10 Thread retard
Sun, 10 Jan 2010 12:25:16 +0100, Chris wrote: > "Nick Sabalausky": >> "Ph": >>> Why a generated file is so huge? [...] >> That's not even a third of a megabyte, why does this keep getting >> brought up as an issue by so many people? > > Execution speed perhaps, since the time elapsed is proportio

Re: Compiler: Size of generated executable file

2010-01-10 Thread dsimcha
== Quote from Chris (inva...@invalid.invalid)'s article > "Nick Sabalausky": > > "Ph": > >> Why a generated file is so huge? [...] > > That's not even a third of a megabyte, why does this keep getting brought > > up as an issue by so many people? > Execution speed perhaps, since the time elapsed is

Re: Division by zero - why no exception?

2010-01-10 Thread A Bothe
OK, thanks!

Re: Compiler: Size of generated executable file

2010-01-10 Thread Chris
"Nick Sabalausky": > "Ph": >> Why a generated file is so huge? [...] > That's not even a third of a megabyte, why does this keep getting brought > up as an issue by so many people? Execution speed perhaps, since the time elapsed is proportional to the number of processor instruction executed. This

Re: Division by zero - why no exception?

2010-01-10 Thread bearophile
> (but be careful, this works only in the main(), probably to keep tidy the > semantics of pure functions): That was not precise, the FPC struct is restored at the end of the main() scope, so if you call a function inside main it will keep the same FPC struct, and this raises the division by ze

Re: Division by zero - why no exception?

2010-01-10 Thread bearophile
A Bothe: > double a=0.0; > double f=1/a; > writeln(f); > ... prints 2.66825e-284 To me this code prints "nan" (I am using the latest D2 compiler, but D1 too prints nan): import std.stdio: writeln; void main() { double a = 0.0; double f = 1 / a; writeln(f); } If you want the division

Division by zero - why no exception?

2010-01-10 Thread A Bothe
Hey everyone, I noticed something: double a=0.0; double f=1/a; writeln(f); ... prints 2.66825e-284 normally it shall throw a exception or do something else ... but it doesn't ... why?

Re: Compiler: Size of generated executable file

2010-01-10 Thread Bane
You can't beat DFL (D Forms Library) on that matter. No overhead. And it looks great. retard Wrote: > Sat, 09 Jan 2010 18:15:44 -0500, Nick Sabalausky wrote: > > > "retard" wrote in message > > news:hiavkv$1me...@digitalmars.com... > >> Sat, 09 Jan 2010 19:44:07 +0100, grauzone wrote: > >> > >

Some random thoughts on Phobos2

2010-01-10 Thread bearophile
This is the sort() of Phobos2, a bit reformatted (a name changed, sortImpl => sortImplementation): void sort(alias less = "a < b", SwapStrategy ss=SwapStrategy.unstable, Range)(Range r) { alias binaryFun!(less) lessFun; static if (is(typeof(lessFun(r.front, r.front)) == bool)) {