Re: Contract checking (Re: enforce()?)

2010-09-10 Thread Jay Byrd
On Wed, 30 Jun 2010 20:03:07 +0100, Norbert Nemec wrote: > On 30/06/10 17:45, Sean Kelly wrote: >> Norbert Nemec Wrote: >> >>> On 28/06/10 12:59, bearophile wrote: Norbert Nemec: > [...] to place code for input contract checking in the *calling* > code. [...] Output contract checks, o

Re: A problem with D contracts

2010-09-10 Thread Jay Byrd
On Sat, 31 Jul 2010 21:33:09 -0400, bearophile wrote: > D contract programming lacks the 'old', but there is another different > problem. Yet another problem is that the logic is completely wrong. The preconditions that should be executed are those of the static type -- the contract is with the

Re: std.concurrency: Returning from spawned function

2010-09-10 Thread Sean Kelly
dsimcha Wrote: > I was thinking about ways to improve std.concurrency w/o compromising its > safety or the simplicity of what already works. Isn't it unnecessarily > restrictive that a spawned function must return void? Since the spawned > thread dies when the spawned function returns, the retur

Re: Bizprac database.. Urgent

2010-09-10 Thread Walter Bright
Daniel Gibson wrote: Walter Bright schrieb: Robert M. Münch wrote: Also known as the "1000 Mann und 1 Befehl" pattern. Captain Rumpelstoss: But... how will I learn to fly, Herr Colonel? Colonel Manfred von Holstein: The way we do everything in the German army: from the book of instructions

Re: New structs

2010-09-10 Thread JMRyan
"Steven Schveighoffer" wrote in news:op.vitwqwoveav...@localhost.localdomain: > I think it was a typo. He meant > > S1* c = new S1() > > BTW, I filed a bug report on this a while back: > > http://d.puremagic.com/issues/show_bug.cgi?id=4247 > > -Steve Yes, and the comment repeated the same

Re: Bizprac database.. Urgent

2010-09-10 Thread Daniel Gibson
Walter Bright schrieb: Robert M. Münch wrote: Also known as the "1000 Mann und 1 Befehl" pattern. Captain Rumpelstoss: But... how will I learn to fly, Herr Colonel? Colonel Manfred von Holstein: The way we do everything in the German army: from the book of instructions. So people in the G

Re: Bizprac database.. Urgent

2010-09-10 Thread Walter Bright
Robert M. Münch wrote: Also known as the "1000 Mann und 1 Befehl" pattern. Captain Rumpelstoss: But... how will I learn to fly, Herr Colonel? Colonel Manfred von Holstein: The way we do everything in the German army: from the book of instructions.

std.concurrency: Returning from spawned function

2010-09-10 Thread dsimcha
I was thinking about ways to improve std.concurrency w/o compromising its safety or the simplicity of what already works. Isn't it unnecessarily restrictive that a spawned function must return void? Since the spawned thread dies when the spawned function returns, the return value could safely be

Re: [Slight OT] TDPL in Russia

2010-09-10 Thread Sean Kelly
Nick Sabalausky Wrote: > "Sean Kelly" wrote in message > news:i6dq0p$2mu...@digitalmars.com... > > > > Dave Mustaine left Metallica before they'd ever released an album, I > > believe. He had a strong influence on their early sound though, and I > > believe he actually wrote a bunch of their

Re: blog: Overlooked Essentials for Optimizing Code

2010-09-10 Thread Sean Kelly
== Quote from Bane (branimir.milosavlje...@gmail.com)'s article > DMD built in profiler don't work yet with multithreaded apps. Is there a plan > to change that or.. ? Yes. It's on my "to do" list, but other things have had priority.

Re: blog: Overlooked Essentials for Optimizing Code

2010-09-10 Thread Bane
DMD built in profiler don't work yet with multithreaded apps. Is there a plan to change that or.. ?

Re: blog: Overlooked Essentials for Optimizing Code

2010-09-10 Thread Walter Bright
bearophile wrote: Walter Bright: Please forgive me for ragging on about this, but you had originally concluded that it was the code generator's fault. I was wrong, of course. I have a lot of respect for you for saying that.

Re: blog: Overlooked Essentials for Optimizing Code

2010-09-10 Thread Jesse Phillips
Walter Bright Wrote: > http://www.reddit.com/r/programming/comments/dc6ir/overlooked_essentials_for_optimizing_code/ I don't like profilers, they slow the execution of my code by like a bagillian times. Actually this article got me to try it again and is the first time I noticed a difference.

Random string samples & unicode

2010-09-10 Thread bearophile
The need to take a random sample without replacement is very common. For example this is how in Python 2.x I create a random string without replacement of fixed size from a input string of chars: from random import sample d = "0123456789" print "".join(sample(d, 2)) This seems similar D2 code:

Re: Overlooked Essentials for Optimizing Code

2010-09-10 Thread Walter Bright
Nick Sabalausky wrote: "1. Using a profiler 2. Looking at the assembly code being executed" Somehow I knew you were going to say that ;) What's interesting is how controversial this is. I've heard every reason in the book (and some very inventive ones) justifying not using a profiler or looki

Re: One more update on d-programming-language.org

2010-09-10 Thread Jérôme M. Berger
David Gileadi wrote: > On 9/10/10 10:20 AM, "Jérôme M. Berger" wrote: >> Great, now the only issue that remains is that the text is still >> too small... >> >> Jerome > > Text sizes are likely not changing. Some folks say the text is too big, > some say it's too small. The text size

Re: [Slight OT] TDPL in Russia

2010-09-10 Thread retard
Fri, 10 Sep 2010 14:46:13 -0400, Steven Schveighoffer wrote: > On Fri, 10 Sep 2010 13:31:05 -0400, Sean Kelly > wrote: > >> Nick Sabalausky Wrote: >>> >>> I was avoiding stating my own Metallica opinions, but now that you >>> mention >>> it, that's exactly how I feel (and yea, I have heard a lot

Re: Overlooked Essentials for Optimizing Code

2010-09-10 Thread Nick Sabalausky
"Walter Bright" wrote in message news:i6dsuc$2su...@digitalmars.com... > http://www.reddit.com/r/programming/comments/dc6ir/overlooked_essentials_for_optimizing_code/ "1. Using a profiler 2. Looking at the assembly code being executed" Somehow I knew you were going to say that ;)

Re: [Slight OT] TDPL in Russia

2010-09-10 Thread Nick Sabalausky
"Sean Kelly" wrote in message news:i6dq0p$2mu...@digitalmars.com... > > Dave Mustaine left Metallica before they'd ever released an album, I > believe. He had a strong influence on their early sound though, and I > believe he actually wrote a bunch of their early songs. Overall I think > Met

Re: blog: Overlooked Essentials for Optimizing Code

2010-09-10 Thread bearophile
Walter Bright: > Please forgive me for ragging on about this, but you had originally concluded > that it was the code generator's fault. I was wrong, of course. For me a compiler was a black box, I didn't understand the difference between code generation and calling a built-in div function. Tha

Re: blog: Overlooked Essentials for Optimizing Code

2010-09-10 Thread Walter Bright
bearophile wrote: Walter Bright: It turns out that dmd's runtime library function had a crummy implementation of long division in it.< In that case I have spent few hours narrowing the problem to a very small benchmark. Then I have left to you to spot and fix the precise cause of the low perf

Re: blog: Overlooked Essentials for Optimizing Code

2010-09-10 Thread bearophile
Walter Bright: >It turns out that dmd's runtime library function had a crummy implementation >of long division in it.< In that case I have spent few hours narrowing the problem to a very small benchmark. Then I have left to you to spot and fix the precise cause of the low performance. And toda

Re: [Slight OT] TDPL in Russia

2010-09-10 Thread Steven Schveighoffer
On Fri, 10 Sep 2010 13:31:05 -0400, Sean Kelly wrote: Nick Sabalausky Wrote: I was avoiding stating my own Metallica opinions, but now that you mention it, that's exactly how I feel (and yea, I have heard a lot of other people say Load was the start of a downfall). I did kind of like "U

Re: Bizprac database.. Urgent

2010-09-10 Thread Robert M. Münch
On 2010-09-09 21:56:28 +0200, Daniel Gibson said: "Reichsteslaspulen aktivieren!" "Achtung!" definitely imperative. You have a missplacement bug here: "ACHTUNG!" always comes first in German. It's to waken everyone up, reset the brain-memory, leveling the hearing and push up your Adrenalin

blog: Overlooked Essentials for Optimizing Code

2010-09-10 Thread Walter Bright
http://www.reddit.com/r/programming/comments/dc6ir/overlooked_essentials_for_optimizing_code/

Re: New structs

2010-09-10 Thread Steven Schveighoffer
On Fri, 10 Sep 2010 13:55:37 -0400, Andrej Mitrovic wrote: Is this D1 code? Because in D2: S2* c = new S1(); // Error: cannot implicitly convert expression (new S1) of type S1* to S2* S2* d = cast(S2*) GC.malloc(S2.sizeof); d = S2(); // Error: cannot implicitly convert expression (S2(0))

Re: New structs

2010-09-10 Thread Andrej Mitrovic
Is this D1 code? Because in D2: S2* c = new S1(); // Error: cannot implicitly convert expression (new S1) of type S1* to S2* S2* d = cast(S2*) GC.malloc(S2.sizeof); d = S2(); // Error: cannot implicitly convert expression (S2(0)) of type S2 to S2* Neither of those work. On Fri, Sep 10, 2010 a

Re: One more update on d-programming-language.org

2010-09-10 Thread David Gileadi
On 9/10/10 10:20 AM, Stewart Gordon wrote: I see the spacing around code blocks seems to have been reduced. Either that or it just doesn't seem too big now. But are you going to do anything about the other issues I raised on 3 Sep? Reposting those suggestions, responses inline: Nice design o

Re: One more update on d-programming-language.org

2010-09-10 Thread David Gileadi
On 9/10/10 10:20 AM, "Jérôme M. Berger" wrote: Great, now the only issue that remains is that the text is still too small... Jerome Text sizes are likely not changing. Some folks say the text is too big, some say it's too small. The text size is based on your browser

Re: [Slight OT] TDPL in Russia

2010-09-10 Thread Sean Kelly
Nick Sabalausky Wrote: > > I was avoiding stating my own Metallica opinions, but now that you mention > it, that's exactly how I feel (and yea, I have heard a lot of other people > say Load was the start of a downfall). I did kind of like "Until it Sleeps" > and maybe one other (forget what), b

New structs

2010-09-10 Thread JMRyan
Consider this uninspiring pair structs: struct S1 {int x}; struct S2 { int x this(int i) {x = i} }; Note that no default constructor is allowed so that S2.init can have a consistent value computed at compile time. Now: S1 a = S1(); // Quintessinal case works fine S2 b = S2();

Re: One more update on d-programming-language.org

2010-09-10 Thread Jérôme M. Berger
Andrei Alexandrescu wrote: > http://d-programming-language.org > > From David Gileadi: the annoying Google Translate bar behavior on > browsers with other languages has been fixed, the behavior when > shrinking and growing the window size has been improved, the Reddit > button is gone, and a few s

Re: One more update on d-programming-language.org

2010-09-10 Thread Stewart Gordon
I see the spacing around code blocks seems to have been reduced. Either that or it just doesn't seem too big now. But are you going to do anything about the other issues I raised on 3 Sep? Stewart.

Re: One more update on d-programming-language.org

2010-09-10 Thread Andrej Mitrovic
There are adverts on the page? Lol, didn't notice. Thanks again, AdblockPlus! On Fri, Sep 10, 2010 at 8:06 AM, Russel Winder wrote: > The Google adverts at the foot of each page need to have some font > sizing/scaling applied, currently they look seriously ugly which has the > effect of ensuring

Re: Bizprac database.. Urgent

2010-09-10 Thread Simen kjaeraas
BLS wrote: Sorry folks, Guess this happens 'cause our deadline was already a month ago, and our working day has 26 hours. Not a problem - it gave us a lot of fun. Repeat it next time, ya hear? :p -- Simen

Re: One more update on d-programming-language.org

2010-09-10 Thread Bane
Dedicated Website! Coool! Me like it!

Re: Bizprac database.. Urgent

2010-09-10 Thread BLS
On 08/09/2010 15:20, BLS wrote: Hi Alex, Dein IB Expert produziert nich kompatible backups.. Melde dich bitte asap. :) Wir muessen HEUTE das product -reordering- in den Griff bekommen. Bjoern Sorry folks, Guess this happens 'cause our deadline was already a month ago, and our working day has

Re: One more update on d-programming-language.org

2010-09-10 Thread JimBob
"Andrei Alexandrescu" wrote in message news:i6bssf$25i...@digitalmars.com... > http://d-programming-language.org > > From David Gileadi: the annoying Google Translate bar behavior on browsers > with other languages has been fixed, the behavior when shrinking and > growing the window size has b