Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread Iain Buclaw
On Jul 1, 2013 7:16 AM, "dennis luehring" wrote: > > Am 01.07.2013 03:07, schrieb Kapps: > >> If you're concerned about performance, I'd recommend against >> using DMD for your release builds. GDC and LDC will give much >> better performance, and GDC works perfectly fine on Windows. LDC >> has som

Re: UDP enhancement

2013-07-01 Thread Jacob Carlborg
On 2013-07-01 03:43, JS wrote: But yet absolutely useless and does nothing over using a field directly. The advantage is that you get virtual methods. I also think it should be possible to manually implement just the setter, or getter. The compiler would only generate what's not already pres

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread Jacob Carlborg
On 2013-07-01 01:14, Steven Schveighoffer wrote: I think memory usage is still important. Many people don't consider that their computer is running hundreds of programs at a time. If each one of those "didn't care" about memory usage, the one that you are currently interested in would not have

Re: Automatic typing

2013-07-01 Thread JS
On Monday, 1 July 2013 at 06:51:53 UTC, deadalnix wrote: On Monday, 1 July 2013 at 06:38:20 UTC, JS wrote: well duh, but it is quite a simple mathematical problem and your counter-example is not one at all. For a statically typed language all types must be known at compile time... so you can'

Re: Automatic typing

2013-07-01 Thread John Colvin
On Monday, 1 July 2013 at 09:31:04 UTC, JS wrote: On Monday, 1 July 2013 at 06:51:53 UTC, deadalnix wrote: On Monday, 1 July 2013 at 06:38:20 UTC, JS wrote: well duh, but it is quite a simple mathematical problem and your counter-example is not one at all. For a statically typed language all

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread Gabi
On Monday, 1 July 2013 at 06:11:20 UTC, dennis luehring wrote: Am 01.07.2013 03:07, schrieb Kapps: If you're concerned about performance, I'd recommend against using DMD for your release builds. GDC and LDC will give much better performance, and GDC works perfectly fine on Windows. LDC has som

Re: Regarding warnings

2013-07-01 Thread Kagamin
On Saturday, 29 June 2013 at 20:26:15 UTC, Jonathan M Davis wrote: http://d.puremagic.com/issues/show_bug.cgi?id=10147 This problem is because the compiler processes warnings too early. If the is expression issues only warnings, it probably should succeed, because those warnings don't escape

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread Iain Buclaw
On 1 July 2013 11:18, Gabi wrote: > On Monday, 1 July 2013 at 06:11:20 UTC, dennis luehring wrote: >> >> Am 01.07.2013 03:07, schrieb Kapps: >>> >>> If you're concerned about performance, I'd recommend against >>> using DMD for your release builds. GDC and LDC will give much >>> better performance

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread dennis luehring
Am 01.07.2013 10:14, schrieb Iain Buclaw: On Jul 1, 2013 7:16 AM, "dennis luehring" wrote: Am 01.07.2013 03:07, schrieb Kapps: If you're concerned about performance, I'd recommend against using DMD for your release builds. GDC and LDC will give much better performance, and GDC works perfectl

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread Iain Buclaw
On 1 July 2013 12:02, dennis luehring wrote: > Am 01.07.2013 10:14, schrieb Iain Buclaw: >> >> On Jul 1, 2013 7:16 AM, "dennis luehring" wrote: >>> >>> >>> Am 01.07.2013 03:07, schrieb Kapps: >>> If you're concerned about performance, I'd recommend against using DMD for your release bui

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread Iain Buclaw
On 1 July 2013 12:38, Iain Buclaw wrote: > On 1 July 2013 12:02, dennis luehring wrote: >> Am 01.07.2013 10:14, schrieb Iain Buclaw: >>> >>> On Jul 1, 2013 7:16 AM, "dennis luehring" wrote: Am 01.07.2013 03:07, schrieb Kapps: > If you're concerned about performance, I'd r

Re: D repl

2013-07-01 Thread Daniel Murphy
"bearophile" wrote in message news:aknmrnhodledtmfyp...@forum.dlang.org... > Dicebot: > >> Can you link his comment? That sounds weird. > > It was years ago, maybe more than three years ago. It's not easy to find. > I have found discussions about this topic, but not comments from Walter: > > htt

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread monarch_dodra
On Monday, 1 July 2013 at 09:14:07 UTC, Jacob Carlborg wrote: On 2013-07-01 01:14, Steven Schveighoffer wrote: I think memory usage is still important. Many people don't consider that their computer is running hundreds of programs at a time. If each one of those "didn't care" about memory us

Re: Automatic typing

2013-07-01 Thread Ary Borenszweig
On 6/30/13 7:39 PM, JS wrote: On Saturday, 29 June 2013 at 19:18:13 UTC, Ary Borenszweig wrote: On 6/27/13 9:34 PM, JS wrote: Would it be possible for a language(specifically d) to have the ability to automatically type a variable by looking at its use cases without adding too much complexity?

Re: Automatic typing

2013-07-01 Thread Ary Borenszweig
On 6/30/13 10:30 PM, JS wrote: On Monday, 1 July 2013 at 01:08:49 UTC, Kenji Hara wrote: 2013/7/1 JS I am simply talking about having the compiler enlarge the type if needed. (this is mainly for built in types since the type hierarchy is explicitly known) Just a simple matter, it would *dr

Re: Automatic typing

2013-07-01 Thread Ary Borenszweig
On 6/30/13 10:56 PM, Timon Gehr wrote: On 07/01/2013 03:08 AM, Kenji Hara wrote: 2013/7/1 JS mailto:js.m...@gmail.com>> I am simply talking about having the compiler enlarge the type if needed. (this is mainly for built in types since the type hierarchy is explicitly known) Just a

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread David
> My 4 gig machine needs swap space... just to surf on internet. > > I think one of the biggest culprits are not the programs, but today's > *shiny* and *exciting* websites... Wow! Then you must be running Windows... I have currently 1.5Gb used, with ~30 tabs open, Kdevelop, a few terminals and

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread John Colvin
On Monday, 1 July 2013 at 14:11:50 UTC, David wrote: My 4 gig machine needs swap space... just to surf on internet. I think one of the biggest culprits are not the programs, but today's *shiny* and *exciting* websites... Wow! Then you must be running Windows... I have currently 1.5Gb used,

Re: Automatic typing

2013-07-01 Thread Timon Gehr
On 07/01/2013 03:44 PM, Ary Borenszweig wrote: On 6/30/13 10:56 PM, Timon Gehr wrote: On 07/01/2013 03:08 AM, Kenji Hara wrote: 2013/7/1 JS mailto:js.m...@gmail.com>> I am simply talking about having the compiler enlarge the type if needed. (this is mainly for built in types since the

Re: Automatic typing

2013-07-01 Thread Walter Bright
On 7/1/2013 6:39 AM, Ary Borenszweig wrote: This is not what I am talking about and it seems quite dangerous to have one variable name masquerade as multiple variables. Why dangerous? D already disallows: int x; { float x; } as an error-prone construct, so why should it allow:

Re: UDP enhancement

2013-07-01 Thread Ali Çehreli
On 06/30/2013 08:54 PM, JS wrote: > On Monday, 1 July 2013 at 02:17:24 UTC, Ali Çehreli wrote: >> I have the complete opposite view: Seeing what m_data explicitly in >> the code would be simpler than reading code to see that data.value >> would mean implicit storage. >> > > huh? There is absolut

Re: Automatic typing

2013-07-01 Thread Ary Borenszweig
On 7/1/13 1:15 PM, Walter Bright wrote: On 7/1/2013 6:39 AM, Ary Borenszweig wrote: This is not what I am talking about and it seems quite dangerous to have one variable name masquerade as multiple variables. Why dangerous? D already disallows: int x; { float x; } as an er

Re: Automatic typing

2013-07-01 Thread Ary Borenszweig
On 7/1/13 1:45 PM, John Colvin wrote: T)(T var) { auto myVar = var.to!string; //do something with myVar string } Ah, that's also ok. But then you have to remember to use myVar instead of var.

Re: Automatic typing

2013-07-01 Thread John Colvin
On Monday, 1 July 2013 at 16:33:56 UTC, Ary Borenszweig wrote: I'll give you an example: # var can be an Int or String def foo(var) var = var.to_s # do something with var, which is now guaranteed to be a string end I can call it like this: foo(1) foo("hello") If I had to put types, I w

Re: D vs C++ - Where are the benchmarks?

2013-07-01 Thread Brad Anderson
On Monday, 1 July 2013 at 06:28:57 UTC, monarch_dodra wrote: On Monday, 1 July 2013 at 02:53:24 UTC, Jonathan M Davis wrote: On Monday, July 01, 2013 04:37:43 Mehrdad wrote: On Sunday, 30 June 2013 at 20:49:28 UTC, Peter Alexander wrote: > sometimes faster Would love an example that demonstra

Re: Automatic typing

2013-07-01 Thread JS
On Monday, 1 July 2013 at 16:15:04 UTC, Walter Bright wrote: On 7/1/2013 6:39 AM, Ary Borenszweig wrote: This is not what I am talking about and it seems quite dangerous to have one variable name masquerade as multiple variables. Why dangerous? D already disallows: int x; { float

Re: Automatic typing

2013-07-01 Thread Walter Bright
On 7/1/2013 9:46 AM, Ary Borenszweig wrote: On 7/1/13 1:45 PM, John Colvin wrote: T)(T var) { auto myVar = var.to!string; //do something with myVar string } Ah, that's also ok. But then you have to remember to use myVar instead of var. Heck, why bother with different variable names

Re: Automatic typing

2013-07-01 Thread John Colvin
On Monday, 1 July 2013 at 16:46:57 UTC, Ary Borenszweig wrote: On 7/1/13 1:45 PM, John Colvin wrote: T)(T var) { auto myVar = var.to!string; //do something with myVar string } Ah, that's also ok. But then you have to remember to use myVar instead of var. Personally I like the explic

Re: Automatic typing

2013-07-01 Thread Timon Gehr
On 07/01/2013 06:15 PM, Walter Bright wrote: On 7/1/2013 6:39 AM, Ary Borenszweig wrote: This is not what I am talking about and it seems quite dangerous to have one variable name masquerade as multiple variables. Why dangerous? D already disallows: int x; { float x; } as

Re: Automatic typing

2013-07-01 Thread Adam D. Ruppe
On Monday, 1 July 2013 at 16:46:57 UTC, Ary Borenszweig wrote: Ah, that's also ok. But then you have to remember to use myVar instead of var. I have wanted to remove a variable from scope before. I think it would be kinda cool if we could do something like __undefine(x), and subsequent uses o

Re: SIMD on Windows

2013-07-01 Thread Jonathan Dunlap
Thanks Manu, I think I understand. Quick questions, so I've updated my test to allow for loop unrolling http://dpaste.dzfl.pl/12933bc8 as the calculation is done over an array of elements and does not depend on the last operation. My problem is that the program reports using 0 time. However, as

Re: UDP enhancement

2013-07-01 Thread JS
On Monday, 1 July 2013 at 16:24:40 UTC, Ali Çehreli wrote: On 06/30/2013 08:54 PM, JS wrote: > On Monday, 1 July 2013 at 02:17:24 UTC, Ali Çehreli wrote: >> I have the complete opposite view: Seeing what m_data explicitly in >> the code would be simpler than reading code to see that data.value

Re: Automatic typing

2013-07-01 Thread Timon Gehr
Don't feed the troll.

Re: Automatic typing

2013-07-01 Thread Walter Bright
On 7/1/2013 9:57 AM, JS wrote: The problem is when such a "idea" is present you get people who are automatically against it for various irrational fears and they won't take any serious look at it to see if it has any merit... If you jump to the conclusion that something is useless without any re

Re: Automatic typing

2013-07-01 Thread deadalnix
On Monday, 1 July 2013 at 16:57:53 UTC, JS wrote: (the above example is at the heart of the matter... regardless if it is probably a valid semantic in D or easily to implement(since no one knows and most don't care because they think it won't benefit them(just like how bill gates thought all e

Re: Automatic typing

2013-07-01 Thread Walter Bright
On 7/1/2013 10:07 AM, Timon Gehr wrote: module b; int x; module a; void main(){ int x; { import b; x = 2; I'd encourage you to submit an enhancement request that would produce the message: Error: import b.x hides local declaration of x } import std.st

Re: Automatic typing

2013-07-01 Thread Walter Bright
On 7/1/2013 10:51 AM, deadalnix wrote: But if you one very stupid one, I declared in the late 90s that a phone with a tactile screen on its whole surface was a stupid idea and that it would never work. I you look hard enough, I guess we all said the most stupid thing at some point. We got to adm

Re: Automatic typing

2013-07-01 Thread MattCoder
On Monday, 1 July 2013 at 17:51:02 UTC, deadalnix wrote: On Monday, 1 July 2013 at 16:57:53 UTC, JS wrote: (the above example is at the heart of the matter... regardless if it is probably a valid semantic in D or easily to implement(since no one knows and most don't care because they think it

Re: SIMD on Windows

2013-07-01 Thread jerro
On Monday, 1 July 2013 at 17:19:02 UTC, Jonathan Dunlap wrote: Thanks Manu, I think I understand. Quick questions, so I've updated my test to allow for loop unrolling http://dpaste.dzfl.pl/12933bc8 The loop body in testSimd doesn't do anything. This line: auto di = d[i]; copies the vector, i

Re: Compiler could elide many more postblit constructor calls

2013-07-01 Thread TommiT
Yet one small observation: This optimization would mean that a lot of the use cases of "auto ref const MyType" parameters (the upcoming non-templated auto ref feature... although I don't know if that's the syntax for it) could be replaced by using "const MyType" parameters. Or, if you look at

Re: Automatic typing

2013-07-01 Thread Ali Çehreli
On 07/01/2013 10:51 AM, deadalnix wrote: > I declared in the late 90s that a phone > with a tactile screen on its whole surface was a stupid idea and that it > would never work. I still think so. :D Ali

Re: SIMD on Windows

2013-07-01 Thread Jonathan Dunlap
Thanks Jerro, I went ahead and used a pointer reference to ensure it's being saved back into the array (http://dpaste.dzfl.pl/52710926). Two things: 1) still showing zero time delta 2) On windows 7 x74, using a SAMPLE_AT size of 3 or higher will cause the program to immediately quit with no

Re: Automatic typing

2013-07-01 Thread Andrei Alexandrescu
On 7/1/13 9:59 AM, Walter Bright wrote: Sorry for the sarcasm, but I just don't get the notion that it's a burden to use a different name for a variable that has a different type and a different purpose. I'd go further and say it is a bad practice to use the same name for such. Reducing the num

Re: Automatic typing

2013-07-01 Thread Andrei Alexandrescu
On 7/1/13 9:57 AM, JS wrote: I think there is big confusion in what I'm "suggesting"(it's not a proposal because I don't expect anyone to take the time to prove its validity... and you can't know how useful it could be if you don't have any way to test it out). It's two distinctly different conc

Re: Automatic typing

2013-07-01 Thread Walter Bright
On 7/1/2013 4:30 PM, Andrei Alexandrescu wrote: Yes, and in fact it's already done. Consider: if (expr) { int a; ... } else { int b; ... } In some C implementations, a and b have the same physical address. In some others, they have distinct addresses. This appears to not be

Re: Automatic typing

2013-07-01 Thread JS
On Monday, 1 July 2013 at 23:30:19 UTC, Andrei Alexandrescu wrote: On 7/1/13 9:57 AM, JS wrote: I think there is big confusion in what I'm "suggesting"(it's not a proposal because I don't expect anyone to take the time to prove its validity... and you can't know how useful it could be if you d

Re: Automatic typing

2013-07-01 Thread Andrei Alexandrescu
On 7/1/13 6:29 PM, JS wrote: Would would be nice is an experimental version of D where would could easily extend the language to try out such concepts to see if they truly are useful and how difficult to implement. e.g., I could attempt to add said "feature", it could be merged with the experimen

Re: Automatic typing

2013-07-01 Thread JS
On Tuesday, 2 July 2013 at 02:15:09 UTC, Andrei Alexandrescu wrote: On 7/1/13 6:29 PM, JS wrote: Would would be nice is an experimental version of D where would could easily extend the language to try out such concepts to see if they truly are useful and how difficult to implement. e.g., I coul

Re: Automatic typing

2013-07-01 Thread Ali Çehreli
On 07/01/2013 07:35 PM, JS wrote: > On Tuesday, 2 July 2013 at 02:15:09 UTC, Andrei Alexandrescu wrote: >> auto a = 2.5; // fine, a is double >> ... >> a = 3; >> > > No, not under what I am talking about. You can't downgrade a type, only > upgrade it. a = 3, a is still a float. Using the concept

Re: Automatic typing

2013-07-01 Thread JS
On Tuesday, 2 July 2013 at 03:17:58 UTC, Ali Çehreli wrote: On 07/01/2013 07:35 PM, JS wrote: > On Tuesday, 2 July 2013 at 02:15:09 UTC, Andrei Alexandrescu wrote: >> auto a = 2.5; // fine, a is double >> ... >> a = 3; >> > > No, not under what I am talking about. You can't downgrade a type, on

Re: SIMD on Windows

2013-07-01 Thread Manu
Maybe make the arrays public? it's conceivable the optimiser could eliminate all that code, since it can prove the results are never referenced... I doubt that's the problem though, just a first guess. On 2 July 2013 09:14, Jonathan Dunlap wrote: > Thanks Jerro, I went ahead and used a pointer r

Re: UDP enhancement

2013-07-01 Thread estew
> It's location in the class my not be the same but that is, in > general, irrelevant unless you are messing with the bits of the class. Actually we do this a lot in C++ where I work to ensure proper alignment. We are also starting to do this in D where we have C++ <-> D bindings so we can m

Re: Automatic typing

2013-07-01 Thread Andrei Alexandrescu
On 7/1/13 7:35 PM, JS wrote: On Tuesday, 2 July 2013 at 02:15:09 UTC, Andrei Alexandrescu wrote: On 7/1/13 6:29 PM, JS wrote: Would would be nice is an experimental version of D where would could easily extend the language to try out such concepts to see if they truly are useful and how difficu

Re: Automatic typing

2013-07-01 Thread F i L
Steven Schveighoffer wrote: There are very good reasons not to do this, even if possible. Especially if the type can change. +1 This sort of inference can only lead to problems down the line, IMO.