Re: std.parallelism changes done

2011-03-24 Thread dsimcha
On 3/24/2011 8:35 AM, spir wrote: On 03/24/2011 05:32 AM, dsimcha wrote: [...] The new docs are at http://cis.jhu.edu/~dsimcha/d/phobos/std_parallelism.html . About the doc: very good. I could understand most of it, while knowing nearly nothing about parallelism prior to reading. 2 details: *

Re: "body" keyword is unnecessary

2011-03-24 Thread KennyTM~
On Mar 24, 11 19:00, sclytrack wrote: == Quote from piotrek (star...@tlen.pl)'s article On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: D already has a long list of keywords, reserved words can't be used as identifiers, which can be annoying. "body" in particular is a common noun that program

Re: std.parallelism changes done

2011-03-24 Thread dsimcha
On 3/24/2011 3:29 AM, Sönke Ludwig wrote: Hm depending on the way the pool is used, it might be a better default to have the number of threads equal the number of cpu cores. In my experience the control thread is mostly either waiting for tasks or processing messages and blocking in between so it

Re: std.parallelism changes done

2011-03-24 Thread dsimcha
On 3/24/2011 3:00 AM, Sönke Ludwig wrote: Am 24.03.2011 05:32, schrieb dsimcha: In addition to improving the documentation, I added Task.executeInNewThread() to allow Task to be useful without a TaskPool. (Should this have a less verbose name?) The threading system I designed for the company I

Re: std.parallelism changes done

2011-03-24 Thread dsimcha
On 3/24/2011 3:23 AM, bearophile wrote: dsimcha: and apologize for getting defensive at times. It happens to mammals, don't worry. The new docs are at http://cis.jhu.edu/~dsimcha/d/phobos/std_parallelism.html . real getTerm(int i) { immutable x = ( i - 0.5 ) * delta;

Re: More than one main

2011-03-24 Thread spir
On 03/24/2011 12:07 PM, bearophile wrote: I have discussed this is little problem about three years ago; in the meantime the situation is changed (rdmd has appeared, DMD has grown the -deps switch, etc). I have a little module named "modu": module modu; import std.stdio; int foo() { retu

is expression: library reference

2011-03-24 Thread Morlan
The library refernce has the following text concerning the is expression: 5. is ( Type Identifier : TypeSpecialization ) The condition is satisfied if Type is the same as TypeSpecialization, or if Type is a class and TypeSpecialization is a base class or base interface of it. The Identifier is de

Re: GSOC 2011

2011-03-24 Thread spir
On 03/24/2011 10:48 AM, Jacob Carlborg wrote: On 2011-03-24 05:30, Andrei Alexandrescu wrote: On 3/23/11 11:42 AM, Luca Boasso wrote: Sorry for the late reply, even tough I'm not an ANTLR expert, given my previous experience with the tool and having read most of the official book, I could help

Re: GSOC 2011

2011-03-24 Thread spir
On 03/24/2011 05:30 AM, Andrei Alexandrescu wrote: On 3/23/11 11:42 AM, Luca Boasso wrote: Sorry for the late reply, even tough I'm not an ANTLR expert, given my previous experience with the tool and having read most of the official book, I could help more on this GSOC idea. I have looked at ht

Re: std.parallelism changes done

2011-03-24 Thread spir
On 03/24/2011 05:32 AM, dsimcha wrote: [...] The new docs are at http://cis.jhu.edu/~dsimcha/d/phobos/std_parallelism.html . About the doc: very good. I could understand most of it, while knowing nearly nothing about parallelism prior to reading. 2 details: * highlight key words only on firs

Re: std.parallelism changes done

2011-03-24 Thread Michel Fortin
On 2011-03-24 03:29:52 -0400, Sönke Ludwig said: Hm depending on the way the pool is used, it might be a better default to have the number of threads equal the number of cpu cores. In my experience the control thread is mostly either waiting for tasks or processing messages and blocking in b

Re: std.parallelism changes done

2011-03-24 Thread Michel Fortin
On 2011-03-24 03:00:01 -0400, Sönke Ludwig said: Am 24.03.2011 05:32, schrieb dsimcha: In addition to improving the documentation, I added Task.executeInNewThread() to allow Task to be useful without a TaskPool. (Should this have a less verbose name?) The threading system I designed for the

Re: std.parallelism changes done

2011-03-24 Thread spir
On 03/24/2011 05:32 AM, dsimcha wrote: One thing Andrei mentioned that I'm really not sure about is what to do with TaskPool.join(). My example for it is still terrible, because I think it's an evolutionary artifact. It was useful in earlier designs that were never released and didn't have high

where unittests should be [was: Strategies for resolving cyclic...]

2011-03-24 Thread spir
On 03/24/2011 07:44 AM, Jonathan M Davis wrote: Personally, I find the unit tests to be _way_ more maintainable when they're right next to the code. I _really_ like that aspect of how unit tests are done in D. However, it does mean that you have to dig through more code to get at the actual funct

Re: Why does it not compile?

2011-03-24 Thread bearophile
Morlan: > I did not ask what to do to compile it. I knew that 54L would do. The problem > is > that in the example I explicitely specify the template parameter as long* so > there > is no reason for the compiler to try and guess T from the type of the function > argument. There is something wron

Re: Why does it not compile?

2011-03-24 Thread Morlan
The program below compiles. Clearly the "if" constraints in my original example are causing trouble. It seems like a bug to me. import std.stdio; void Foo(T:T*)(T arg) { writeln("arg of Foo:", arg, typeid(T)); } void main() { Foo!(long*)(54); }

Re: "body" keyword is unnecessary

2011-03-24 Thread bearophile
sclytrack: > Copied the following line from the Vala (=mostly reference counted language) > web page. > > "It is possible to use a reserved keyword as identifier name by prefixing it > with > the @ character. This character is not part of the name. For example, you can > name > a method foreac

More than one main

2011-03-24 Thread bearophile
I have discussed this is little problem about three years ago; in the meantime the situation is changed (rdmd has appeared, DMD has grown the -deps switch, etc). I have a little module named "modu": module modu; import std.stdio; int foo() { return 0; } int main() { writeln("modu.main")

Re: "body" keyword is unnecessary

2011-03-24 Thread sclytrack
== Quote from piotrek (star...@tlen.pl)'s article > On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: > > D already has a long list of keywords, reserved words can't be used as > > identifiers, which can be annoying. "body" in particular is a common > > noun that programmers would gladly use as a v

Re: Why does it not compile?

2011-03-24 Thread Daniel Gibson
Am 24.03.2011 11:49, schrieb Morlan: I did not ask what to do to compile it. I knew that 54L would do. The problem is that in the example I explicitely specify the template parameter as long* so there is no reason for the compiler to try and guess T from the type of the function argument. There

Re: Why does it not compile?

2011-03-24 Thread Morlan
I did not ask what to do to compile it. I knew that 54L would do. The problem is that in the example I explicitely specify the template parameter as long* so there is no reason for the compiler to try and guess T from the type of the function argument. There is something wrong here.

Re: Why does it not compile?

2011-03-24 Thread bearophile
Morlan: > ... This compiles, 54 is an int: import std.stdio; void Foo(T: T*)(T arg) if(!is(T == int)) { writeln("Arg of Foo: ", arg, " ", typeid(T)); } void Foo(T: T*)(T arg) if(is(T == int)) { writeln("int Foo!"); } void main() { Foo!(long*)(54L); } Generally for questions like th

Re: Against enforce()

2011-03-24 Thread Kagamin
So how do you solve the problem? - > > This is a good example of why it's difficult to decide what "user input" > > is. One could consider that the 'user' in this case is the developer > > using the library, but I don't think that's the right choice. > > > > I'd say it's a bug, this is c

Why does it not compile?

2011-03-24 Thread Morlan
import std.stdio; void Foo(T:T*)(T arg) if(!is(T==int)) { writeln("arg of Foo:", arg, typeid(T)); } void Foo(T:T*)(T arg) if(is(T==int)) { writeln("int Foo!"); } void main() { Foo!(long*)(54); }

Current purity offenders

2011-03-24 Thread bearophile
As Phobos develops more, there are some commonly used Phobos functions that aren't pure yet: import std.algorithm, std.typecons, std.conv, std.array, std.range; pure auto foo(int[] a) { sort(a); auto a2 = array(iota(a.length)); return tuple(text(a), a2); } void main() {} But a fun

Re: GSOC 2011

2011-03-24 Thread Jacob Carlborg
On 2011-03-24 05:30, Andrei Alexandrescu wrote: On 3/23/11 11:42 AM, Luca Boasso wrote: Sorry for the late reply, even tough I'm not an ANTLR expert, given my previous experience with the tool and having read most of the official book, I could help more on this GSOC idea. I have looked at http:

Re: Pretty please: Named arguments

2011-03-24 Thread Daniel Gibson
Am 24.03.2011 07:36, schrieb Bekenn: On 3/23/2011 9:12 AM, Bruno Medeiros wrote: Now that is an argument. Although I still don't agree: it really shouldn't take that long to setup an IDE (if Netbeans and/or its PHP plugin are crappy, don't use that to blame all IDEs :P ). But in any case this i

Re: Request for review: std.net.isemail

2011-03-24 Thread Jacob Carlborg
On 2011-03-23 22:20, Dmitry Olshansky wrote: On 23.03.2011 1:04, Jacob Carlborg wrote: I've now finished the port of Dominic Sayers' PHP is_email function (http://www.dominicsayers.com/isemail) and sending it for review. A few comments: * Due to limitations in std.regex some unit tests fail an

Re: D Tools Special Interest Group (SIG)

2011-03-24 Thread Jacob Carlborg
On 2011-03-23 20:29, Jonas Drewsen wrote: On 23/03/11 15.07, Jacob Carlborg wrote: On 2011-03-23 00:41, Jonas Drewsen wrote: Hi, It seems that every now and then a discussion about build tools or D package management pops up in this group. Many people on this list have a huge amount of experie

Re: Request for review: std.net.isemail

2011-03-24 Thread Jacob Carlborg
On 2011-03-23 18:09, Jonathan M Davis wrote: On 2011-03-22 23:21, dsimcha wrote: On 3/22/2011 6:04 PM, Jacob Carlborg wrote: I've now finished the port of Dominic Sayers' PHP is_email function (http://www.dominicsayers.com/isemail) and sending it for review. A few comments: * Due to limitatio

Re: "body" keyword is unnecessary

2011-03-24 Thread piotrek
On Wed, 23 Mar 2011 23:17:32 +0100, Alvaro wrote: > D already has a long list of keywords, reserved words can't be used as > identifiers, which can be annoying. "body" in particular is a common > noun that programmers would gladly use as a variable name in physics > simulation, astronomy, mechanic

Re: If you're on an Windows XP or Vista box and live in the U.S...

2011-03-24 Thread Bekenn
California, Windows XP via Virtual PC: 1999-Mar-01 00:00:00 1999-Mar-08 00:00:00 1999-Mar-14 00:00:00 1999-Mar-14 01:00:00 1999-Mar-14 01:00:00 1999-Mar-14 02:00:00 1999-Mar-14 23:00:00 1999-Mar-21 23:00:00 1999-Mar-28 23:00:00 1999-Mar-31 23:00:00 1999-Apr-02 23:00:00 1999-Apr-04 00:00:00 1999-A

Re: std.parallelism changes done

2011-03-24 Thread Sönke Ludwig
Hm depending on the way the pool is used, it might be a better default to have the number of threads equal the number of cpu cores. In my experience the control thread is mostly either waiting for tasks or processing messages and blocking in between so it rarely uses a full core, wasting the av

Re: std.parallelism changes done

2011-03-24 Thread bearophile
dsimcha: > and apologize for getting defensive at times. It happens to mammals, don't worry. > The new docs are at > http://cis.jhu.edu/~dsimcha/d/phobos/std_parallelism.html . >real getTerm(int i) { >immutable x = ( i - 0.5 ) * delta; >return delta / ( 1.0 + x * x ) ; >

Re: "body" keyword is unnecessary

2011-03-24 Thread Sönke Ludwig
I'm all for this change. Since there are already similar differences between 1.0 and 2.0 (e.g. invariant()) and projects can be fixed by a more or less simple search and replace, this would be a cheap way to clean up a keyword that can truly get in your way (in contrast to some others that hav

Re: "body" keyword is unnecessary

2011-03-24 Thread Bekenn
Interestingly, you don't even have to remove "body" from the syntax to remove it as a keyword, as it's only used in this context (that I know of), where no other symbols make sense.

Re: std.parallelism changes done

2011-03-24 Thread Sönke Ludwig
Am 24.03.2011 05:32, schrieb dsimcha: In addition to improving the documentation, I added Task.executeInNewThread() to allow Task to be useful without a TaskPool. (Should this have a less verbose name?) The threading system I designed for the company I work for uses priority per task to contro

<    1   2