Re: FF Plugins (Was: DConf 2013 Opening Keynote by Walter Bright: video and slides available)

2013-05-10 Thread Colin Grogan

On Thursday, 9 May 2013 at 18:49:17 UTC, Nick Sabalausky wrote:

On Thu, 09 May 2013 18:35:08 +0200
Rob T al...@ucora.com wrote:


Snipidy snip


Damn you all, now I have to go back to firefox...


Re: DConf 2013 Opening Keynote by Walter Bright: video and slides available

2013-05-10 Thread JN

Can't wait for Manu's slides/video to come up :)

I have to disagree with some of the points in the keynote though. 
The part with algorithm in D example, I don't know but map(a = 
a.idup) isn't exactly obvious. About the scope vs no-scope - it'd 
be interesting to see how try-finally version looks like in 
comparison.


About the IDE discussion near the end of keynote - I know a lot 
of you people are happy just using Vim/Emacs + command line 
compiling, but having a proper IDE is a big part in language 
adoption nowadays. I can't speak for VisualD and MonoD, but I've 
heard they are nice, I am using DDT which is also good, although 
debugging on windows with DMD isn't that fun. A good example 
would be Visual Basic 6.0 - everyone seems to hate it, yet a lot 
of people (mostly non-programmers) use it to make apps because in 
few clicks you can make a GUI application. Same would apply to 
Java too - language isn't the best there is, and coding Java 
without Netbeans/Eclipse/IntelliJ would be a new dimension of 
pain but with those IDEs writing stuff is 'fun'.


All in all, great to see D community getting together to discuss 
and share stuff =)


Re: DConf 2013 Opening Keynote by Walter Bright: video and slides available

2013-05-10 Thread Regan Heath

On Fri, 10 May 2013 11:45:21 +0100, JN 666to...@wp.pl wrote:


Can't wait for Manu's slides/video to come up :)


I want them all!  :D

I have to disagree with some of the points in the keynote though. The  
part with algorithm in D example, I don't know but map(a = a.idup)  
isn't exactly obvious.


Agreed.  This is a bit of a wart IMO.

About the scope vs no-scope - it'd be interesting to see how try-finally  
version looks like in comparison.


Have you seen Andre's slides comparing these.. does anyone have a link?

About the IDE discussion near the end of keynote - I know a lot of you  
people are happy just using Vim/Emacs + command line compiling, but  
having a proper IDE is a big part in language adoption nowadays. I can't  
speak for VisualD and MonoD, but I've heard they are nice, I am using  
DDT which is also good, although debugging on windows with DMD isn't  
that fun. A good example would be Visual Basic 6.0 - everyone seems to  
hate it, yet a lot of people (mostly non-programmers) use it to make  
apps because in few clicks you can make a GUI application. Same would  
apply to Java too - language isn't the best there is, and coding Java  
without Netbeans/Eclipse/IntelliJ would be a new dimension of pain but  
with those IDEs writing stuff is 'fun'.


I think Walters point about not making a language require an IDE to add  
boilerplate is a good one, the boilerplate itself, and the fact the  
language requires it is the real issue, not whether an IDE is used to  
generate it.


As for IDE's in general, I use MSVC pretty much predominantly and when  
doing GUI development in C# it's RAD :p  Doing the same thing with a text  
editor would be painful.  The boilerplate in this case is the  
skeleton/structure for the GUI library, not the language, so it's a  
separate boilerplate issue, and not one that good language design can  
obviate.


That, plus all the other nice features of an IDE - many of which can be  
synthesized by an editor with scripting support, are the reasons to use  
one.  Integrated debugging, etc.


All in all, great to see D community getting together to discuss and  
share stuff =)


Wish I could have made the trip too :(

R

--
Using Opera's revolutionary email client: http://www.opera.com/mail/


DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Andrei Alexandrescu

Enjoy!

https://www.youtube.com/watch?v=mPr2UspS0fE

Andrei


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Andrei Alexandrescu

On 5/10/13 8:08 AM, Andrei Alexandrescu wrote:

Enjoy!

https://www.youtube.com/watch?v=mPr2UspS0fE

Andrei


Vote up! 
http://www.reddit.com/r/programming/comments/1e2boo/dconf_2013_day_1_talk_2_copy_and_move_semantics/


Andrei


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Iain Buclaw
On 10 May 2013 13:08, Andrei Alexandrescu seewebsiteforem...@erdani.orgwrote:

 Enjoy!

 https://www.youtube.com/watch?**v=mPr2UspS0fEhttps://www.youtube.com/watch?v=mPr2UspS0fE

 Andrei



Are we releasing one talk every couple of days?


-- 
Iain Buclaw

*(p  e ? p++ : p) = (c  0x0f) + '0';


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread David
Am 10.05.2013 14:11, schrieb Andrei Alexandrescu:
 On 5/10/13 8:08 AM, Andrei Alexandrescu wrote:
 Enjoy!

 https://www.youtube.com/watch?v=mPr2UspS0fE

 Andrei
 
 Vote up!
 http://www.reddit.com/r/programming/comments/1e2boo/dconf_2013_day_1_talk_2_copy_and_move_semantics/
 
 
 Andrei

Onto reddit frontpage!


Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread deadalnix

http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/

A trick that I used to use more and more, so I ended up creating 
a generic solution and wrote an article about it.


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Jacob Carlborg

On 2013-05-10 14:15, Iain Buclaw wrote:


Are we releasing one talk every couple of days?


We want all talks right now :)

--
/Jacob Carlborg


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread John Colvin

On Friday, 10 May 2013 at 12:32:50 UTC, deadalnix wrote:

http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/

A trick that I used to use more and more, so I ended up 
creating a generic solution and wrote an article about it.


Fancy some proof-reading again?


Re: DConf 2013 Opening Keynote by Walter Bright: video and slides available

2013-05-10 Thread Jeff Nowakowski

On 05/08/2013 05:41 PM, Andrei Alexandrescu wrote:


VOTE UP!!!

http://www.reddit.com/r/programming/comments/1dyinq/dconf_2013_opening_keynote_by_walter_bright/


I have to laugh at the reddit id: 1dying

:)


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread John Colvin

On Friday, 10 May 2013 at 12:47:17 UTC, John Colvin wrote:

On Friday, 10 May 2013 at 12:32:50 UTC, deadalnix wrote:

http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/

A trick that I used to use more and more, so I ended up 
creating a generic solution and wrote an article about it.


Fancy some proof-reading again?


I went ahead and did a brief pass over it as I read it: 
http://db.tt/DqRbEO5u


Nice article. This is the sort of thing that D really excels at 
compared to C++.


Is this on Reddit yet?


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread Dmitry Olshansky

10-May-2013 16:32, deadalnix пишет:

http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/


A trick that I used to use more and more, so I ended up creating a
generic solution and wrote an article about it.


Neat but somewhat limited.

E.g. this is exactly the same switch madness we sought to avoid:

void process(T)(T data) {
alias Type = typeof(data);

static if(is(Type == A)) {
// Code that handle the case where it is an A.
} else static if(is(Type == B)) {
// Code that handle the case where it is an B.
} else {
static assert(0, You must handle type  ~ Type.stringof);
}
}

t.apply!process();


I'd rather see another idiom supported too:

t.apply!(processA, processB)();

where e.g.
void proccessA(A value){ ... }

void processB(B value){ ... }

Anther thing is that will allow succinct notations like:

int squared = t.apply!(
(A a) = a.x*a.x + a.y*a.y,
(B b) = b.x*b.x + b.y*b.y + b.z*b.z
)();

I sure don't fancy putting static if into lambdas.
Another thing about it is it allows specifying safe catch all or default 
case.



--
Dmitry Olshansky


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread deadalnix

On Friday, 10 May 2013 at 13:04:58 UTC, John Colvin wrote:

On Friday, 10 May 2013 at 12:47:17 UTC, John Colvin wrote:

On Friday, 10 May 2013 at 12:32:50 UTC, deadalnix wrote:

http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/

A trick that I used to use more and more, so I ended up 
creating a generic solution and wrote an article about it.


Fancy some proof-reading again?


I went ahead and did a brief pass over it as I read it: 
http://db.tt/DqRbEO5u




Awesome, I'll update the article.

Nice article. This is the sort of thing that D really excels at 
compared to C++.


Is this on Reddit yet?


No, feel free to put it if you think it is appropriate !


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread deadalnix

On Friday, 10 May 2013 at 13:11:37 UTC, Dmitry Olshansky wrote:

E.g. this is exactly the same switch madness we sought to avoid:



The article don't plan to avoid this, but to make the tagged 
union safe. I agree this is a plus, but didn't really took time 
to make that work.



void process(T)(T data) {
alias Type = typeof(data);

static if(is(Type == A)) {
// Code that handle the case where it is an A.
} else static if(is(Type == B)) {
// Code that handle the case where it is an B.
} else {
static assert(0, You must handle type  ~ 
Type.stringof);

}
}

t.apply!process();


I'd rather see another idiom supported too:

t.apply!(processA, processB)();

where e.g.
void proccessA(A value){ ... }

void processB(B value){ ... }



That can work indeed.


Anther thing is that will allow succinct notations like:

int squared = t.apply!(
(A a) = a.x*a.x + a.y*a.y,
(B b) = b.x*b.x + b.y*b.y + b.z*b.z
)();

I sure don't fancy putting static if into lambdas.
Another thing about it is it allows specifying safe catch all 
or default case.


That last one won't work. DMD don't accept locals here, even if 
they are functions.


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread deadalnix

On Friday, 10 May 2013 at 13:51:11 UTC, deadalnix wrote:

Is this on Reddit yet?


No, feel free to put it if you think it is appropriate !


http://www.reddit.com/r/programming/comments/1e2h99/type_safe_tagged_union_in_d/

Someone else did.


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Andrei Alexandrescu

On 5/10/13 8:15 AM, Iain Buclaw wrote:

On 10 May 2013 13:08, Andrei Alexandrescu seewebsiteforem...@erdani.org
mailto:seewebsiteforem...@erdani.org wrote:

Enjoy!

https://www.youtube.com/watch?__v=mPr2UspS0fE
https://www.youtube.com/watch?v=mPr2UspS0fE

Andrei



Are we releasing one talk every couple of days?


Two a week.

Andrei



Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread Andrei Alexandrescu

On 5/10/13 8:32 AM, deadalnix wrote:

http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/


A trick that I used to use more and more, so I ended up creating a
generic solution and wrote an article about it.


Article is good, could use a few copyediting fixes (including in title). 
Any volunteers?


Andrei


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread John Colvin

On Friday, 10 May 2013 at 13:51:11 UTC, deadalnix wrote:


Awesome, I'll update the article.



Andrei pointed out that the title needed fixing:

I suggest:
Type-safe tagged unions in the D programming language.
Type-safe tagged unions in D.


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread John Colvin

On Friday, 10 May 2013 at 14:37:49 UTC, Andrei Alexandrescu wrote:

On 5/10/13 8:32 AM, deadalnix wrote:

http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/


A trick that I used to use more and more, so I ended up 
creating a

generic solution and wrote an article about it.


Article is good, could use a few copyediting fixes (including 
in title). Any volunteers?


Andrei


Done (except the title)
http://forum.dlang.org/post/dszacipmkljzjybco...@forum.dlang.org


Re: DConf 2013 Opening Keynote by Walter Bright: video and slides available

2013-05-10 Thread Simen Kjaeraas
On Fri, 10 May 2013 15:00:44 +0200, Jeff Nowakowski j...@dilacero.org  
wrote:



On 05/08/2013 05:41 PM, Andrei Alexandrescu wrote:


VOTE UP!!!

http://www.reddit.com/r/programming/comments/1dyinq/dconf_2013_opening_keynote_by_walter_bright/


I have to laugh at the reddit id: 1dying

:)


1dyinq, btw

--
Simen


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread Artur Skawina
On 05/10/13 14:32, deadalnix wrote:
 http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/
 
 A trick that I used to use more and more, so I ended up creating a generic 
 solution and wrote an article about it.

Nothing 'shameless' about it.

But Real Programmers don't use mixins...

   struct TU(TYPES...) {
  union { TYPES data; }
  ubyte type;
  static assert(TYPES.length=typeof(type).max);

  T opAssign(T)(T a) {
 foreach(N, TYPE; TYPES)
static if (is(T==TYPE)) {
   type = N;
   return data[N] = a;
}
 assert(0);
  }
  this(T)(T a) { this = a; }

  DT as(DT)() @property {
 foreach(N, TYPE; TYPES)
static if (is(DT==TYPE)) {
   if (type==N)
  return data[N];
   else
  assert(0, Cannot access a '~typeString(type)~' as 
~DT.stringof);
}
 assert(0);
  }
  
  auto ref apply(alias f)() {
 foreach(N, TYPE; TYPES)
static if (is(typeof(f(data[N] // Comment this line out for 
strict CT checks.
   if (N==type)
  return f(data[N]);
 assert(0, Could not apply '~typeof(f).stringof~' to 
~typeString(type));
  }
  
  static string typeString()(typeof(type) n) {
 foreach(N, TYPE; TYPES)
if (N==n)
   return TYPE.stringof;
 assert(0);
  }
   }

   double sqr(double a) { return a*a; }
   int sqr(int a) { return a*a; }

   void main() {
  import std.stdio;
  TU!(int, double, string) u;
  u = 257;
  writeln(u);
  writeln(u.data[0], , , u.data[1]);
  writeln(u.as!int);
  //writeln(u.as!double); // RT error
  writeln(u.apply!sqr());
  u = 3.14;
  writeln(u.apply!sqr());
  u = blah;
  //writeln(u.apply!sqr()); // CT error in 'strict' mode, RT error 
otherwise.
  
  // Not currently accepted:
  //writeln(u.apply!(function(a){return a*a;})());
  //writeln(u.apply!(a=a*a)());
   }

Something that wasn't obvious from your examples is that templates are not 
necessary
when implementing the 'processing' functions - overloading is enough.

The interesting aspect of this is what improvements to the language would help 
to
make this code both a) simpler and more readable, and b) even more efficient.
Manual optimizations, such as 'if-sequnences'-'switch', should /not/ result in
harder to read code. The locals-can't-be-parms-to-local-templates restriction
should only apply when really necessary (for example: static functions/lambdas 
can
be allowed). Etc.

artur


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread deadalnix

On Friday, 10 May 2013 at 14:53:23 UTC, John Colvin wrote:

On Friday, 10 May 2013 at 13:51:11 UTC, deadalnix wrote:


Awesome, I'll update the article.



Andrei pointed out that the title needed fixing:

I suggest:
Type-safe tagged unions in the D programming language.
Type-safe tagged unions in D.


I updated everything. Now I need to sleep :D Thank you very much 
my english if often very ad hoc.


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Iain Buclaw
On 10 May 2013 15:38, Andrei Alexandrescu seewebsiteforem...@erdani.orgwrote:

 On 5/10/13 8:15 AM, Iain Buclaw wrote:

 On 10 May 2013 13:08, Andrei Alexandrescu seewebsiteforem...@erdani.org
 mailto:SeeWebsiteForEmail@**erdani.org seewebsiteforem...@erdani.org
 wrote:

 Enjoy!

 
 https://www.youtube.com/watch?**__v=mPr2UspS0fEhttps://www.youtube.com/watch?__v=mPr2UspS0fE
 
 https://www.youtube.com/**watch?v=mPr2UspS0fEhttps://www.youtube.com/watch?v=mPr2UspS0fE
 

 Andrei




 Are we releasing one talk every couple of days?


 Two a week.

 Andrei



Just so long as I haven't aged a year before my talk is online.  ;)


PS: technically age a year in 18 days...


-- 
Iain Buclaw

*(p  e ? p++ : p) = (c  0x0f) + '0';


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Jacob Carlborg

On 2013-05-10 16:38, Andrei Alexandrescu wrote:


Two a week.


Is there a reason for this?

--
/Jacob Carlborg


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Andrei Alexandrescu

On 5/10/13 11:24 AM, Jacob Carlborg wrote:

On 2013-05-10 16:38, Andrei Alexandrescu wrote:


Two a week.


Is there a reason for this?


Maximize impact.

Andrei



Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread SomeDude

On Friday, 10 May 2013 at 15:24:43 UTC, Jacob Carlborg wrote:

On 2013-05-10 16:38, Andrei Alexandrescu wrote:


Two a week.


Is there a reason for this?


It's good to keep people busy with D. ;)
There have been way to many Go posts on reddit lately. :D


Re: DConf 2013 Opening Keynote by Walter Bright: video and slides available

2013-05-10 Thread Jeff Nowakowski

On 05/10/2013 11:06 AM, Simen Kjaeraas wrote:


1dyinq, btw


Right, q not g, thanks. That's what I get for not copying and 
pasting. I still find it amusing, though. I like to think there's a 
ghost in the machine having fun with us.


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Jesse Phillips

On Friday, 10 May 2013 at 12:08:10 UTC, Andrei Alexandrescu wrote:

Enjoy!

https://www.youtube.com/watch?v=mPr2UspS0fE

Andrei


These need to be updates on Kickstarter too.


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread John Colvin

On Friday, 10 May 2013 at 12:11:16 UTC, Andrei Alexandrescu wrote:

On 5/10/13 8:08 AM, Andrei Alexandrescu wrote:

Enjoy!

https://www.youtube.com/watch?v=mPr2UspS0fE

Andrei


Vote up! 
http://www.reddit.com/r/programming/comments/1e2boo/dconf_2013_day_1_talk_2_copy_and_move_semantics/


Andrei


Currently top of /r/programming hot :)


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread Piotr Szturmaj

W dniu 10.05.2013 14:32, deadalnix pisze:

http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/


A trick that I used to use more and more, so I ended up creating a
generic solution and wrote an article about it.


Here's my try on this: 
https://github.com/pszturmaj/json-streaming-parser/blob/master/json.d#L111 
lines 111-184. It supports Self notation, so it's possible to create 
recursive unions given that Self is accessible through some indirection. 
TypeTag should be an enum with increasing values starting with 0. I just 
noticed, opAssign is prepended with underscore, I probably forgot to 
remove it after debugging:)


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Nick Sabalausky
On Fri, 10 May 2013 08:08:09 -0400
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:

 Enjoy!
 
 https://www.youtube.com/watch?v=mPr2UspS0fE
 

Will this be going up on archive.org, too?



Re: DConf 2013 Opening Keynote by Walter Bright: video and slides available

2013-05-10 Thread Walter Bright

On 5/10/2013 3:45 AM, JN wrote:

Can't wait for Manu's slides/video to come up :)

I have to disagree with some of the points in the keynote though. The part with
algorithm in D example, I don't know but map(a = a.idup) isn't exactly
obvious.


You're right, that one isn't.



About the scope vs no-scope - it'd be interesting to see how
try-finally version looks like in comparison.


http://dlang.org/exception-safe.html



Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread David
Am 10.05.2013 19:28, schrieb Nick Sabalausky:
 On Fri, 10 May 2013 08:08:09 -0400
 Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:
 
 Enjoy!

 https://www.youtube.com/watch?v=mPr2UspS0fE

 
 Will this be going up on archive.org, too?
 
https://archive.org/details/dconf2013-day01-talk02


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Nick Sabalausky
On Fri, 10 May 2013 19:48:09 +0200
David d...@dav1d.de wrote:

 Am 10.05.2013 19:28, schrieb Nick Sabalausky:
  On Fri, 10 May 2013 08:08:09 -0400
  Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:
  
  Enjoy!
 
  https://www.youtube.com/watch?v=mPr2UspS0fE
 
  
  Will this be going up on archive.org, too?
  
 https://archive.org/details/dconf2013-day01-talk02

Hmm, that's strange, it's not showing up (yet?) when searching their
site for dconf: https://archive.org/search.php?query=dconf

Anyway, thanks.



Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread Andrei Alexandrescu

On 5/10/13 1:49 PM, Andrei Alexandrescu wrote:

On 5/10/13 10:15 AM, deadalnix wrote:

On Friday, 10 May 2013 at 13:51:11 UTC, deadalnix wrote:

Is this on Reddit yet?


No, feel free to put it if you think it is appropriate !


http://www.reddit.com/r/programming/comments/1e2h99/type_safe_tagged_union_in_d/



Someone else did.


I think this link went to spam. Posted here:

http://www.reddit.com/r/programming/comments/1e2x6a/typesafe_tagged_unions_in_the_d_programming/


A general note about posting to reddit: it often happens that posts from 
infrequent posters go to spam by means of some automatic rule. When that 
happens you need to message the moderators and politely ask them to 
manually instate the post because it's legit. Once you accumulate karma 
and all, your posts will be auto-approved.


I've done that for a while and accumulated good karma (and a good 
relationship with the mods to the extent that could be called such). So 
if you don't care about accumulating reddit points feel free to ask me 
to post links on your behalf. But of course the more strong posters in 
the D community, the better.



Andrei


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Nick Sabalausky
On Fri, 10 May 2013 08:08:09 -0400
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:
 Enjoy!
 
 https://www.youtube.com/watch?v=mPr2UspS0fE
 

Torrents up for both the low-quality FLV (from YouTube) and the
full-quality MP4 (from archive.org):

http://semitwist.com/download/misc/dconf2013/

I don't know how much interest there is in torrents of these now that
archive.org is (awesomely) hosting direct downloads of the original
full quality. But since I'm planning on grabbing all of them anyway, I
may as well continue tossing the torrents together while I'm at it.



Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Ali Çehreli

On 05/10/2013 11:45 AM, Nick Sabalausky wrote:

 Torrents up for both the low-quality FLV (from YouTube) and the
 full-quality MP4 (from archive.org):

 http://semitwist.com/download/misc/dconf2013/

Thank you for doing this!

 I don't know how much interest there is in torrents

Never used torrents... :)

Ali



Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread Walter Bright

On 5/10/2013 10:56 AM, Andrei Alexandrescu wrote:

A general note about posting to reddit: it often happens that posts from
infrequent posters go to spam by means of some automatic rule. When that happens
you need to message the moderators and politely ask them to manually instate the
post because it's legit. Once you accumulate karma and all, your posts will be
auto-approved.

I've done that for a while and accumulated good karma (and a good relationship
with the mods to the extent that could be called such). So if you don't care
about accumulating reddit points feel free to ask me to post links on your
behalf. But of course the more strong posters in the D community, the better.


The post will also get a lot more upvotes if an abstract is also posted as the 
first comment on reddit. Otherwise, people won't click on the link.




Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread Jesse Phillips

On Friday, 10 May 2013 at 17:56:14 UTC, Andrei Alexandrescu wrote:
A general note about posting to reddit: it often happens that 
posts from infrequent posters go to spam by means of some 
automatic rule. When that happens you need to message the 
moderators and politely ask them to manually instate the post 
because it's legit. Once you accumulate karma and all, your 
posts will be auto-approved.


Well that is stupid. It would be like StackOverflow closing 
questions of new users and waiting for people to vote to open.


Re: Shameless autopromotion : type safe tagged union in D

2013-05-10 Thread Timon Gehr

On 05/10/2013 02:32 PM, deadalnix wrote:

http://www.deadalnix.me/2013/05/10/type-safe-tagged-union-in-d-programming-language/


A trick that I used to use more and more, so I ended up creating a
generic solution and wrote an article about it.


I'd have implemented your TaggedUnion struct as follows. (I believe this 
is equivalent to your implementation.)


struct TaggedUnion(T...){
private{
union{ T members; }
int tag;
static int indexOf(S)(){
foreach(i,t;T) static if(is(S==t)) return i;
return -1;
}
}
this(T)(T t) if(~indexOf!T){
members[indexOf!T]=t;
tag=indexOf!T;
}
auto ref apply(alias fun)(){
switch(tag){
foreach(i,_;T) case i: return fun(members[i]);
default: assert(0);
}
}
}

But note that this is as unsafe as the original implementation. You will 
at least have to provide a postblit constructor and a destructor in 
order to keep the promise of safety.


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread MattCoder

On Friday, 10 May 2013 at 12:08:10 UTC, Andrei Alexandrescu wrote:

Enjoy!

https://www.youtube.com/watch?v=mPr2UspS0fE

Andrei


Very good talk. One more vote up!


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Walter Bright

On 5/10/2013 5:11 AM, Andrei Alexandrescu wrote:

On 5/10/13 8:08 AM, Andrei Alexandrescu wrote:

Enjoy!

https://www.youtube.com/watch?v=mPr2UspS0fE

Andrei


Vote up!
http://www.reddit.com/r/programming/comments/1e2boo/dconf_2013_day_1_talk_2_copy_and_move_semantics/


https://news.ycombinator.com/item?id=5688464


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Mariusz `shd` Gliwiński

On Friday, 10 May 2013 at 12:08:10 UTC, Andrei Alexandrescu wrote:

Enjoy!

https://www.youtube.com/watch?v=mPr2UspS0fE


I've added them to wiki.
Will URLs like http://dconf.org/talks/bright.html be active in 
like 2 or more years? It would be great to have links like 
http://dconf.org/talks/2013/* or maybe you're giving up on the 
next conferences? :)


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Andrei Alexandrescu
On 5/10/13 7:37 PM, Mariusz `shd` Gliwiński alienballa...@gmail.com 
wrote:

On Friday, 10 May 2013 at 12:08:10 UTC, Andrei Alexandrescu wrote:

Enjoy!

https://www.youtube.com/watch?v=mPr2UspS0fE


I've added them to wiki.
Will URLs like http://dconf.org/talks/bright.html be active in like 2 or
more years? It would be great to have links like
http://dconf.org/talks/2013/* or maybe you're giving up on the next
conferences? :)


Great idea. Stay tuned.

Andrei


Re: DConf 2013 Day 1 Talk 2: Copy and Move Semantics in D by Ali Cehreli

2013-05-10 Thread Flamaros

On Friday, 10 May 2013 at 18:45:15 UTC, Nick Sabalausky wrote:

On Fri, 10 May 2013 08:08:09 -0400
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:

Enjoy!

https://www.youtube.com/watch?v=mPr2UspS0fE



Torrents up for both the low-quality FLV (from YouTube) and the
full-quality MP4 (from archive.org):

http://semitwist.com/download/misc/dconf2013/

I don't know how much interest there is in torrents of these 
now that
archive.org is (awesomely) hosting direct downloads of the 
original
full quality. But since I'm planning on grabbing all of them 
anyway, I
may as well continue tossing the torrents together while I'm at 
it.


I prefers the torrent, thx.


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Lars T. Kyllingstad
On Thursday, 9 May 2013 at 21:10:55 UTC, Steven Schveighoffer 
wrote:
4) Reviewers' roles and responsibilities.  I am not defining 
how a reviewer gets assigned, not sure how that should work, 
and it likely depends on the tool we use.


I think each Phobos module should have an official maintainer.  
The modules' documentation have Author sections, but those 
typically list everyone that have ever made a significant 
contribution to a module, and many of those people have long 
since withdrawn from the D community.


I propose that there be additional Maintainer sections which, 
for each module, specify *one* person who has the primary 
responsibility for that module.  If and when that person 
disappears from the D community, she or he must be replaced by 
someone else.


Whenever someone makes a pull request, it should be assigned to 
the maintainer for the module which is most affected by the 
request.  That person also has the primary review responsibility 
for the request, in the manner described by Steve, but may of 
course reassign it to someone else if necessary or appropriate.


For example, I would be happy to be the official maintainer of 
std.complex, std.path and std.process.  I feel a certain 
ownership towards those modules, and I very much want to review 
changes made to them.  Unfortunately, time currently does not 
permit me to scan the forums, Github and Bugzilla every day for 
discussions, pull requests and bug reports pertaining to these 
modules.  If, however, someone would assign them to me, I would 
be automatically notified via e-mail, and then I would definitely 
take the time to deal with it.


There will of course be requests that have a large impact on 
several modules, and there should also be someone that takes care 
of coordinating the reviews of these.


Lars


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Lars T. Kyllingstad
On Thursday, 9 May 2013 at 21:10:55 UTC, Steven Schveighoffer 
wrote:

[...]

I want to define a process for a requester to follow in order 
to submit a pull request [...]


I agree with most of what you say, except maybe this:


2) pull request review process stages
   a) submitted - pull request awaiting initial verification of 
pull request prerequisites.
   b) unassigned - pull request passes prerequisites, and is 
awaiting assignment to an approved reviewer (process for 
assignment TBD)
   c) ready for review - pull request is assigned, but reviewer 
has not started looking at it.
   d) official review - pull request in review by reviewer.  
Next stage can be e - h.
   e) needs work - pull request needs work to be able to be 
accepted (only use this stage if original requester is not 
immediately responsive).  Go back to c after fixed.
   f) rejected - pull request is rejected.  Can be re-opened by 
another official contributor.

   g) approved - pull request is approved for pull.
   h) conditionally approved - pull request is approved, but 
with minor changes (e.g. comment or ddoc changes).
   i) pulled/closed - pull request is approved by second 
reviewer (this does not need to be an in-depth review)


This seems to require yet another tool besides Bugzilla and 
GitHub, which I think we should avoid.  It's bad enough to have 
information in two places, without scattering it even more.  If 
we can somehow make it work within the current toolset, then I am 
all for it.


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Daniel Murphy
Steven Schveighoffer schvei...@yahoo.com wrote in message 
news:op.wwugwetleav7ka@stevens-macbook-pro.local...

 1. Make the process defined and transparent so both reviewers and 
 submitters understand what is going on, and what is expected.

Sounds good.

 2. Make someone own the review.  Without ownership, there will be long 
 delays, and that reflects a sense of disapproval or apathy towards the 
 submitter or his idea, even if that isn't the case.  I like how the 
 feature review on the newsgroup has a review manager and he sets a 
 deadline.  That works out REALLY well.


My impression is that sometimes modules sit around for quite a while waiting 
for a review manager.  How are reviewers going to be assigned and how will 
it be ensured that they don't let if fall through the cracks?

 The recent thread on the review non-process outlined a story from the 
 perspective of the submitter that looked to me very different than what 
 actually happened from the reviewer side (reading the comments after the 
 fact).


Having a written process we can refer people to will hopefully help with 
that, even if it is just what we currently have.


h) One of the reviewers (not sure if it should be primary or 
 secondary)
 should close any bugzilla bugs fixed by the pull request.  Can this be
 automated?

 This is what we are currently doing (sort of) and I think it would be 
 better
 to have the requester be responsible for closing the original bug.

 I think we should push for full automation.  I think it can be done with 
 github (and actually, I think it already automatically records the commit 
 in bugzilla).

 The problem I see with making the submitter do it is, the submitter may 
 not be active at the time, or may not care.  The pull request is done, and 
 he has his fix, but we need to make sure the bug list is updated properly.


I don't think this is a problem with dmd, as most pull requests come from 
the same small group of people. (I think Kenji has done over 1/3)

 This
 often requires trying each original test case along with other measure to
 ensure the bug was actually fixed.

 Oh!  I completely forgot!  Another requirement for a pull request to be 
 accepted:

   g) Any fixed bugs MUST be accompanied by a unit test that fails with the 
 current code but passes with the change.


Sure, but this does not ensure that the tests have full coverage of the 
problem, or even full coverage of the cases presented in the bug report. 
This probably applies to dmd more than the others where failures can have 
very complex interacting causes.

 If this is included, the automated tests should cover that.


I would love to have a way to add a test case, and have the autotester 
ensure both that it fails with the old version, and works with the new one. 
(or the other way around for fail-compilation cases)  One of my pet projects 
is an automated regression sourcer finder where you can give it a test case 
and it attempts to build with the last N releases.  Anyway, another time.

 Sometimes pull requests are only partial
 fixes and while the requester (hopefully) knows this, the reviewer will 
 have
 to work all this out in addition to looking at the actual changes.

 These would be more complex cases.  I think they would be rare (at least 
 from a library side, not sure about dmd).  It's important to note that 
 reviewers are volunteers, and if you are not willing to take the time to 
 do a full review, you should give it to someone else.


Right, the really common one in dmd is bugs that apply to D1.

 Perhaps the description requirement can be detailed to say if this is 
 only a partial fix, that should be noted.

 Ideally this goes on bugzilla or github issues so we don't end up
 fragmenting the information even further.

 agreed.  I'm really leaning toward github issues since it already 
 integrates with github pull requests (right? never used it before), 
 probably involves less work to automate.


Yeah, I think we can use labels to set the states and it has assignment 
built in.

 My main problem is when I find I have time and energy to review some pull
 requests, I never know which ones are ready.  I usually find myself 
 looking
 through them from the front or the back, and rarely get very far.

 A big improvement would be a two-state system:
 - Ready for review
 - Not ready for review

 I think this is important.  A pull request shouldn't be Ready until it's 
 also submitted to the tracking system.  The issue should reflect the 
 current state.  In other words, you should be searching for unassigned 
 issues in the correct states, not pull requests.


If we use github issues and the pulls and issues are linked, this should be 
fine.

 The submitter sets it to ready when they think it's done, and it goes to 
 Not
 Ready when any of the following happens:
 - An official reviewer decides it needs more work
 - It fails the autotester (ideally except for those intermittent 
 failures)
 - The submitter 

Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Daniel Murphy
Idan Arye generic...@gmail.com wrote in message 
news:eltfkesxpdjgjesrl...@forum.dlang.org...
 According to the description of the Bugzilla service hook on GitHub, it 
 can automatically close bugs via pull requests, but only since version 4.0 
 of Bugzilla - and the one on d.puremagic is only 3.4.1. I have no idea 
 what it takes to upgrade a Bugzilla - but the benefit of automatically 
 closing bugs would probably justify it.


Quite often bug reports need to be reviewed before being closed. (At least 
for dmd)

 Anyways, why keep using Bugzilla instead of GitHub issues?

Last I checked github issues still can't do some basic things like moving 
bugs between components, you can find lists online.  I'm sure they will 
improve this in the future... 




Re: Åkerön: Demographics poll

2013-05-10 Thread Simen Kjaeraas

On Fri, 10 May 2013 01:30:25 +0200, Tyro[17] nos...@home.com wrote:

In preparation for DConf 2014, I would like to ascertain where the  
community sits today in size, dispersion and interests. Please do not  
discuss this topic here in the newsgroup. Submit responses to the email  
address below instead.


Years Programming:


17.



What programming language(s) do you use and how long?


Professionaly: C++, C#.

Hobby: D, C#, C++, Common Lisp, JavaScript.



Area of Interest?


Uhm... programming? I guess algorithms in general, simulation perhaps.



Location (State/Country)?


Norway.



Student/Employed/Unemployed/Retired?


Employed.



Using D Professionally? How long?


Nope. Did on my last job, for about two months.



How did you learn about D?


Happened way back in 2006, I think. Can't remember how. Been an avid
user and follower ever since.


List (in decreasing order of importance) five features you like most  
about D:


Templates
CTFE
GC
OpDispatch
alias this


List (in decreasing order of importance) five features you dislike most  
about D:


Blasphemy! :p

Impure-by-default
System-by-default
Lack of unique storage class
Can't think of anything for #4 and #5

If you also allow features that I feel are missing:

Unicode operator overloading
Restrictions based on UDAs (nothrow, pure, nogc, safe, trusted and system
  implemented in Druntime instead of the compiler? Yes please)


--
Simen


Re: The liabilities of binding rvalues to ref

2013-05-10 Thread Dicebot

On Friday, 10 May 2013 at 05:01:22 UTC, deadalnix wrote:

Why ? Range behavior is undefined when passed by value.


Ugh, it is usually other way around, at least given current 
typical range implementations.


Re: Åkerön: Demographics poll

2013-05-10 Thread Dicebot
Please do not discuss this topic here in the newsgroup. Submit 
responses to the email address below instead.


;)


Re: Åkerön: Demographics poll

2013-05-10 Thread Dejan Lekic

On Thursday, 9 May 2013 at 23:30:26 UTC, Tyro[17] wrote:
In preparation for DConf 2014, I would like to ascertain where 
the community sits today in size, dispersion and interests. 
Please do not discuss this topic here in the newsgroup. Submit 
responses to the email address below instead.


Years Programming:

What programming language(s) do you use and how long?

Area of Interest?

Location (State/Country)?

Student/Employed/Unemployed/Retired?

Using D Professionally? How long?

How did you learn about D?

List (in decreasing order of importance) five features you like 
most about D:


List (in decreasing order of importance) five features you 
dislike most about D:


I understand and respect your rights to privacy and will not 
distribute your information to anyone else. Emails received 
will be processed and subsequently destroyed.


Åkerön is my company and the entity that will be using the 
aggregated information during DConf 2014.


Andrew Edwards
-
http://www.akeron.co
auto getAddress()
{
string location = @;
string period = .;
return (info ~ location ~ afidem ~ period ~ org);
}


You have these answers more/less answered on LinkedIn, group D 
Development Network. As of this moment, the group has 256 
members, and it is constantly growing.


Link: 
http://www.linkedin.com/groups/D-Developer-Network-3923820?gid=3923820trk=hb_side_g


Re: The liabilities of binding rvalues to ref

2013-05-10 Thread Dmitry Olshansky

10-May-2013 04:18, Manu пишет:

On 10 May 2013 09:20, Rob T al...@ucora.com mailto:al...@ucora.com
wrote:

On Thursday, 9 May 2013 at 22:42:14 UTC, Manu wrote:

And it's

even questionable that scope as originally intended can be
properly
implemented anyway.


...so, the problem is no different than 'auto ref' as you
mention above.
It's not implemented as drafted, and we're debating what's actually
correct. Clearly the draft was incomplete in both cases.
I only support the proposal (from others) that scope ref makes
so much more
sense, and I think we've also proven it can be made to work
syntactically
without holes, which I don't believe is so for auto ref.


However despite the elusiveness of a solution, it looks like we'll
be able to implement auto ref as was originally intended. We may
also be able to implement scope as was originally intended, but not
if we use it for another purpose.


Except that auto ref as originally intended seems to have been a flawed
design, as evidenced by the massive waves this issue keeps creating.



Simply put it wasn't ever implemented like it was meant to.
When something doesn't exist it's hard to believe that its broken.

In fact I expected it to mean what you seem to attribute to scope ref 
i.e. ~ as C++ const minus logical const part.
The desire to make 2 versions of function in template case is serving 
one use case only - perfect forwarding and IMO is hacky. Funnily tough 
this corner-case beast (for templates) is implemented and the chief 
usage (for normal functions) isn't.


--
Dmitry Olshansky


Re: The liabilities of binding rvalues to ref

2013-05-10 Thread Peter Alexander

On Friday, 10 May 2013 at 00:08:50 UTC, Manu wrote:
As I've had to re-iterate countless times, and such is the 
massive fallacy

behind all of these threads, this whole debate is NOT about
lvalues/rvalues, and I wish people would stop using the term 
'rvalue' in
their posts, I worry that they misunderstand the problem every 
time it's

said.

This code is broken:
  void f(ref int x) {}
  int x;
  f(x);

x is an lvalue.


There's nothing broken about that code. In what way do you 
believe it is broken?



The problem we need to solve is that of a function being able 
to safely

receive a _temporary_.


temporary = rvalue



Re: Åkerön: Demographics poll

2013-05-10 Thread Tyro[17]

On 5/10/13 4:04 AM, Dejan Lekic wrote:

On Thursday, 9 May 2013 at 23:30:26 UTC, Tyro[17] wrote:

In preparation for DConf 2014, I would like to ascertain where the
community sits today in size, dispersion and interests. Please do not
discuss this topic here in the newsgroup. Submit responses to the
email address below instead.



You have these answers more/less answered on LinkedIn, group D
Development Network. As of this moment, the group has 256 members, and
it is constantly growing.


Interesting. Thank you very much for the insight. Somehow I find myself 
hoping that we have a little more than 256 users: 255 not counting 
myself since I'm a member of that group. I really appreciate you taking 
the time to respond though.



Link:
http://www.linkedin.com/groups/D-Developer-Network-3923820?gid=3923820trk=hb_side_g



Regards,
Andrew Edwards

http://www.akeron.co
auto getAddress() {
string location = @, period = .;
return (info ~ location ~ afidem ~ period ~ org);
}


Re: Singletons, alias this and DMD crashing

2013-05-10 Thread Jacob Carlborg

On 2013-05-09 15:07, Leandro Motta Barros wrote:

Thanks for the comment! I noticed this wouldn't compile, though I
haven't really wondered why so. My email was more about the compiler
bug than about using alias this with singletons.

Anyway, while trying to circumvent the compiler bug, I did this:

import std.stdio;

class SImpl
{
void foo()
{
   writeln(foo!);
}

private this() { }
}

class S
{
static @property SImpl instance()
{
   if (_i is null)
  _i = new SImpl();

   return _i;
}

static SImpl _i;

alias instance this;
}

void main()
{
S.foo();
}

This works and compiles with DMD 2.062. (I don't like to have
to write this additional code manually, but I'll try to make something
about it :-) )


Aha, you added an additional class.

--
/Jacob Carlborg


Re: DConf 2013 keynote

2013-05-10 Thread Andrej Mitrovic
On 5/9/13, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote:
 On Thu, 09 May 2013 10:26:46 -0400
 Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:

 On 5/9/13 10:26 AM, Andrei Alexandrescu wrote:
  With all this focus on technicalities, we forgot to discuss the
  gist of it: what did you guys think of the talk?

I liked the talk very much, although I preferred the 2007 talk where
both of you presented the talk together and allowed questions to be
asked during the presentation. Still I'm looking forward to the other
more technical presentations.

P.S. it seems the #dconf hashtag is being hijacked by another conference now:
https://twitter.com/GetApp/status/332770427296419841


Re: D pullrequest review process rant

2013-05-10 Thread Jacob Carlborg

On 2013-05-09 19:02, Sean Kelly wrote:


Here's a breakdown of some of the more popular formatting styles:
http://en.wikipedia.org/wiki/Indent_style.  I think D tends towards
Allman style (which I think the astyle formatter calls BSD style).  My
code is formatted a bit differently in terms of spacing around parens
but I'd be happy to have it changed--I use Allman style these days too.


DMD uses the weird Horstmann style in some places. Which in my opinion 
is horrible.


--
/Jacob Carlborg


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Jacob Carlborg

On 2013-05-09 23:10, Steven Schveighoffer wrote:


OK, so now to implement this kind of thing, we need to have a
collaboration tool that allows tracking the review through its
workflow.  No idea what the best tool or what a good tool would be.  We
need something kind of like an issue tracker (can github issue tracker
do this?).  I don't have a lot of experience with doing online project
collaboration except with D.  I like trello, but it seems to have not
caught on here.


Github can handle this. You can assign people to a pull request and add 
labels to indicate different statuses or whatever you want them to mean. 
At least I think you can add labels to pull requests. I don't currently 
have any open pull request for any of my projects so I cannot test it.


--
/Jacob Carlborg


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Jacob Carlborg

On 2013-05-10 08:57, Lars T. Kyllingstad wrote:


This seems to require yet another tool besides Bugzilla and GitHub,
which I think we should avoid.  It's bad enough to have information in
two places, without scattering it even more.  If we can somehow make it
work within the current toolset, then I am all for it.


We could use labels on github for this.

--
/Jacob Carlborg


Re: DConf 2013 keynote

2013-05-10 Thread deadalnix

On Thursday, 9 May 2013 at 21:32:19 UTC, Nick Sabalausky wrote:

On Thu, 09 May 2013 10:26:46 -0400
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:


On 5/9/13 10:26 AM, Andrei Alexandrescu wrote:
 With all this focus on technicalities, we forgot to discuss 
 the

 gist of it: what did you guys think of the talk?


That should better go in the digitalmars.D group though...



Very good talk! And good production quality, too. This would be 
a

great thing to point people towards to introduce them to D.



First good talk. Some tweaking can be done to make it better.

One of them is the plane metaphor. I now know that Walter is a 
big fan of plane (and he knows quite a lot about that !) but the 
problem is that the point is very subjective (the plane want to 
fly).


I'm sure the plane idea can be kept, but must be presented in a 
more factual/less subjective manner.


I'll go through the talk once again if I find time to do it and 
get more details.


Re: Åkerön: Demographics poll

2013-05-10 Thread Regan Heath
On Fri, 10 May 2013 09:04:06 +0100, Dejan Lekic dejan.le...@gmail.com  
wrote:
You have these answers more/less answered on LinkedIn, group D  
Development Network. As of this moment, the group has 256 members, and  
it is constantly growing.


Link:  
http://www.linkedin.com/groups/D-Developer-Network-3923820?gid=3923820trk=hb_side_g


Some of us don't use LinkedIn seriously and have woefully incomplete and  
sometimes incorrect profiles :p


R

--
Using Opera's revolutionary email client: http://www.opera.com/mail/


Re: D graph library

2013-05-10 Thread Joseph Rushton Wakeling
On 05/08/2013 06:12 PM, H. S. Teoh wrote:
 On Wed, May 08, 2013 at 02:34:32PM +0200, Joseph Rushton Wakeling wrote:
 Finally, a reasonable question is whether they should return ranges of
 actual nodes or edges, or ranges of node/edge IDs.
 
 I think the distinction is mostly superfluous. One could always wrap IDs
 in a struct:

I'm being daft.  Of _course_ the ranges should be of nodes or edges, because you
want to be able to do things like

foreach(n; g.nodes) {   // g is the graph ... :-)
foreach(m; n.neighbours) {
...
}
}

 It should also be possible to define arbitrary collections of node
 properties, such as colour, type, textual labels, numerical properties
 etc., and to query if a node has them (preferably at compile-time).
 
 Hmm. I'm not sure about requiring such attributes. I'd go for a more
 generic approach, such as if an algorithm requires some attribute (say
 weight), then it could take a compile-time parameter that maps .weight
 to whatever actual attribute is in the graph node / edge. For example:
 
   auto findShortestPath(alias weight,G)(G graph, G.node start,
   G.node end) { ... }
 
   struct Graph {
   struct Node { ... }
   alias node = Node;
   struct Edge {
   double length;
   @property double euclideanDistance();
   ...
   }
   }
 
   Graph g;
   Graph.Node x, y;
   auto pathByLength = findShortestPath!length(g, x, y);
   auto pathByDist = findShortestPath!euclideanDistance(g, x, y);
 
 This allows the same graph to be evaluated multiple ways, as this
 example shows, without needing to create wrappers or proxy objects.

I don't think what I was proposing was at odds with what you describe here.  For
sure it's helpful to be able to map attributes as you describe here.  What I
mean is simply it's helpful to be able to define arbitrary properties (and
property names) that will be associated with edges, not that edges should be
_obliged_ to have a certain set of associated parameters.

 I'm tentatively considering defining the node type within the graph
 itself (G.node above), as a way of reducing the number of compile-time
 parameters, but this may not be necessary, and may be limiting in some
 cases. Have to think about it a bit more.

Can you expand on this?

 I think it's better if each algorithm has a specific set of properties
 they expect to be present, and use compile-time parameters to map them
 onto concrete graph properties.

Again, I don't think this is in contradiction with what I'm suggesting -- of
course individual algorithms should expect and check for certain parameters, and
compile-time parameters can be used to map them to the algorithm.

 Also, I'm not sure about isWeighted... I would expect most graph
 algorithms to either not care about weights (in which case the entire
 graph can be weightless) or require weights on all edges (in which case
 isWeighted is redundant). Or am I ignorant of algorithms that process
 weights that only exist in some edges but not others?

Consider path length -- e.g. a path v1 - v2 - v3 has length 2 for an
unweighted graph, length w_{1, 2} + w_{2, 3} for a weighted graph.  That in turn
has implications for shortest-path-length calculations, and the optimal
algorithm to calculate shortest paths thus depends on whether you're dealing
with the weighted or unweighted case.

All of this in turn impacts on any metrics or algorithms that depend on
distances between nodes.  For example, today I'm going to be implementing [*] an
algorithm to calculate betweenness centrality:
http://www.cs.ucc.ie/~rb4/resources/Brandes.pdf  This does need to be modified,
albeit trivially, for the weighted case.

[* Inside some custom-written code for a very particular application, I'm
afraid.  This is why I want to create a general-purpose graph library, to stop
me having to do things like this :-P ]

 I think it would help discussion if we have a list (even if tentative)
 of algorithms we'd like to implement, along with what each algorithm
 expects from the graph (weights, colors, directedness, etc.). Then we
 can evaluate which properties/functions/etc. are really necessary, and
 which are just icing on the cake that can be omitted with no real
 drawbacks. I think the more minimal the API the better -- it makes the
 resulting module easier to understand and use, and makes it more likely
 we'll actually finish implementing it. :-P

Agree about minimal API, but I think what I've described previously is pretty
minimal ... :-)

As for algorithms, igraph has a very substantial list:
http://igraph.sourceforge.net/doc/html/igraph-Structural.html

We could probably scratch our own itch to a degree (ha!) in terms of choosing
what to implement, but stuff like shortest path calculation, centrality measures
and so on seem like good starting points.

 

Re: D pullrequest review process rant

2013-05-10 Thread Daniel Murphy
Jacob Carlborg d...@me.com wrote in message 
news:kmii5f$1nut$1...@digitalmars.com...

 DMD uses the weird Horstmann style in some places. Which in my opinion is 
 horrible.


This is the old code and is discouraged in new code. 




Re: DConf 2013 keynote

2013-05-10 Thread Dmitry Olshansky

10-May-2013 01:32, Nick Sabalausky пишет:

On Thu, 09 May 2013 10:26:46 -0400
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:


On 5/9/13 10:26 AM, Andrei Alexandrescu wrote:

With all this focus on technicalities, we forgot to discuss the
gist of it: what did you guys think of the talk?



That should better go in the digitalmars.D group though...



Very good talk! And good production quality, too. This would be a
great thing to point people towards to introduce them to D.



Indeed and I can actually hear questions :)
BTW these were quite interesting in their own right like if there is a 
way to cleanly manipulate carry bit within the language.



And Walter does a good job on stage. *Never* comes across as
pretentious, or cocky or full-of-...various things...like *cough*a
certain former Apple leader*cough* always did. (Minor nit: Forgot to
mention Mono-D on the last question, though.)



I loved the warm informal atmosphere here, too bad I've been stuck with 
visa approval at the last moment. The idea to smuggle myself in some 
crate of rice doesn't seem half-bad now ;)



--
Dmitry Olshansky


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Steven Schveighoffer

On Fri, 10 May 2013 07:00:08 -0400, Jacob Carlborg d...@me.com wrote:


On 2013-05-09 23:10, Steven Schveighoffer wrote:


OK, so now to implement this kind of thing, we need to have a
collaboration tool that allows tracking the review through its
workflow.  No idea what the best tool or what a good tool would be.  We
need something kind of like an issue tracker (can github issue tracker
do this?).  I don't have a lot of experience with doing online project
collaboration except with D.  I like trello, but it seems to have not
caught on here.


Github can handle this. You can assign people to a pull request and add  
labels to indicate different statuses or whatever you want them to mean.  
At least I think you can add labels to pull requests. I don't currently  
have any open pull request for any of my projects so I cannot test it.




That sounds fine too.  I wasn't aware of that feature.

-Steve


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Jacob Carlborg

On 2013-05-10 14:41, Steven Schveighoffer wrote:


That sounds fine too.  I wasn't aware of that feature.


There are milestones as well, if that is of any use.

--
/Jacob Carlborg


Re: The liabilities of binding rvalues to ref

2013-05-10 Thread Steven Schveighoffer
On Fri, 10 May 2013 00:44:08 -0400, Jonathan M Davis jmdavisp...@gmx.com  
wrote:



On Thursday, May 09, 2013 22:33:09 Steven Schveighoffer wrote:
On Thu, 09 May 2013 22:10:22 -0400, Jonathan M Davis  
jmdavisp...@gmx.com

 That would be great except for UFCS. How would you designate the ref
 when it's
 the first argument? And I think that it's worse to have ref optional  
at

 the
 callsite than to not have it at all.

1. using UFCS is optional.  c[i].fix() works as well as fix(c[i]).


That would be an option, but as I explain belong, I think that having  
ref be

optional at the call site is a bad idea.


2. We could say UFCS has an implicit ref-at-callsite if needed, and will
not compile for rvalues.  If you think about it, 'this' is implicitly  
ref,

and UFCS is calling like the first argument is the 'this' reference.


That would make using UFCS with ranges generally illegal, as most  
range-based
funtions do not have ref parameters, and you generally don't want them  
to be

passed by ref.


I misunderstood.  You would not need ref at callsite because it's  
optional.  So this actually is fine.  You don't need to do anything.


How would you prevent 'rvalue' ranges from going in?  Don't use UFCS, and  
put ref at callsite.


The problem with this whole rvalue/lvalue scheme is that rvalue and lvalue  
are not good terms to describe what we want.  Just because you can't  
assign to an rvalue doesn't mean you can't assign to a member of that  
rvalue, it could be a pointer.


This has come up on the newsgroup before, and I really do think that  
having it
as optional is worse than not having it. If it's required, then when you  
see

that an argument is marked with ref, you know that the parameter is a ref
parameter, and when you see an argument without ref, you know that the
parameter is not a ref parameter. And the compiler enforces both, so you
always catch it when the function changes.


That is not the point of this suggestion.  It would simply be to ensure  
changes from an lvalue to an rvalue don't compile.  It would only be used  
in those cases.


In other words, ref at callsite means I have an lvalue.  If that  
changes, no compilation.


-Steve


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Steven Schveighoffer
On Fri, 10 May 2013 03:05:31 -0400, Daniel Murphy  
yebbl...@nospamgmail.com wrote:



Steven Schveighoffer schvei...@yahoo.com wrote in message



2. Make someone own the review.  Without ownership, there will be long
delays, and that reflects a sense of disapproval or apathy towards the
submitter or his idea, even if that isn't the case.  I like how the
feature review on the newsgroup has a review manager and he sets a
deadline.  That works out REALLY well.



My impression is that sometimes modules sit around for quite a while  
waiting
for a review manager.  How are reviewers going to be assigned and how  
will

it be ensured that they don't let if fall through the cracks?


We can't be perfect :)  This is a volunteer army.  If that is what  
happens, that is what happens.  At least we should make the submitter  
aware of that likelihood.


A weekly check of pull requests that are assigned but stale might be a  
good idea.



Oh!  I completely forgot!  Another requirement for a pull request to be
accepted:

  g) Any fixed bugs MUST be accompanied by a unit test that fails with  
the

current code but passes with the change.



Sure, but this does not ensure that the tests have full coverage of the
problem, or even full coverage of the cases presented in the bug report.
This probably applies to dmd more than the others where failures can have
very complex interacting causes.


Up to your discretion as a reviewer what you require.  It's impossible to  
formalize this requirement as a documented/objective measure.  I would say  
that 9 times out of 10, the bug report will contain a minimized example  
that causes the issue to occur, that should just be included as a  
unit-test.



If this is included, the automated tests should cover that.



I would love to have a way to add a test case, and have the autotester
ensure both that it fails with the old version, and works with the new  
one.


I didn't consider that the auto-tester wouldn't test that the test case  
fails on the existing code.  I suppose that would just be up to the  
reviewer whether you wanted to go through the effort of testing with that  
test on the current master branch, or eyeball it and assume it does fail.   
The most important thing is that a unit test is inserted to verify the fix  
actually works, and that a regression is caught immediately.



agreed.  I'm really leaning toward github issues since it already
integrates with github pull requests (right? never used it before),
probably involves less work to automate.



Yeah, I think we can use labels to set the states and it has assignment
built in.


That is perfect.  A couple people have mentioned we can do this without  
github issues, the pull requests support labels and assignment.  Though  
mutually exclusive labels might be awkward.  Perhaps we should redefine  
the stages with that in mind.



I think we are on the same page, my stages don't have to be real
statuses, but it's important to formalize workflow and statuses so both
sides know what is going on and what is expected.


I would like real statuses because they are searchable.  The wiki is  
almost
good enough here, but having them connected to the actual pull requests  
and

automatically changed when they fail the test suite would be much much
better.  Maybe this applies better to dmd where the majority are bugfixes
instead of enhancements, I don't know.  I think we're agreeing on most of
it.


I meant not ALL the stages have to be real statuses :)  We clearly want  
something searchable to see the pull requests you are assigned and which  
ones are ready for review.


I will take a look at github issues and github's pull request features to  
see what level of features we need.


-Steve


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Daniel Murphy
Steven Schveighoffer schvei...@yahoo.com wrote in message 
news:op.wwvee6wleav7ka@stevens-macbook-pro.local...
 Sure, but this does not ensure that the tests have full coverage of the
 problem, or even full coverage of the cases presented in the bug report.
 This probably applies to dmd more than the others where failures can have
 very complex interacting causes.

 Up to your discretion as a reviewer what you require.  It's impossible to 
 formalize this requirement as a documented/objective measure.  I would say 
 that 9 times out of 10, the bug report will contain a minimized example 
 that causes the issue to occur, that should just be included as a 
 unit-test.


Ok, I think this might be different for dmd vs phobos.


 I didn't consider that the auto-tester wouldn't test that the test case 
 fails on the existing code.  I suppose that would just be up to the 
 reviewer whether you wanted to go through the effort of testing with that 
 test on the current master branch, or eyeball it and assume it does fail. 
 The most important thing is that a unit test is inserted to verify the fix 
 actually works, and that a regression is caught immediately.


Absolutely agreed, this is fundamental.  After all it isn't really fixed 
unless you can guarantee it _stays_ fixed.  Adding tests also has the nice 
effect of pushing the burden of keeping it working onto the next person to 
modify the code. :)


 That is perfect.  A couple people have mentioned we can do this without 
 github issues, the pull requests support labels and assignment.  Though 
 mutually exclusive labels might be awkward.  Perhaps we should redefine 
 the stages with that in mind.


They support labels and assignment because they automatically get an issue 
created for them.  I think you have to turn on issue support in order to 
actually add labels to the pull requests (or at least I can't find the 
interface).




Re: Åkerön: Demographics poll

2013-05-10 Thread Steven Schveighoffer

On Thu, 09 May 2013 19:30:25 -0400, Tyro[17] nos...@home.com wrote:


http://www.akeron.co


Is that right?  Or is it akeron.com?

Both seem to be boilerplate web sites of just-registered domains.

-Steve


What D needs... more KITTEH!

2013-05-10 Thread Regan Heath
Seriously tho.. perhaps an interactive D tutor would be kinda neat,  
something like:

http://lolcode.codeschool.com/levels/1/challenges/1

R

--
Using Opera's revolutionary email client: http://www.opera.com/mail/


Re: DConf 2013 keynote

2013-05-10 Thread H. S. Teoh
On Thu, May 09, 2013 at 05:32:18PM -0400, Nick Sabalausky wrote:
 On Thu, 09 May 2013 10:26:46 -0400
 Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:
 
  On 5/9/13 10:26 AM, Andrei Alexandrescu wrote:
   With all this focus on technicalities, we forgot to discuss the
   gist of it: what did you guys think of the talk?
  
  
  That should better go in the digitalmars.D group though...
  
 
 Very good talk! And good production quality, too. This would be a
 great thing to point people towards to introduce them to D.

+1. I listened to the talk yesterday... it was awesome! Can't wait for
the other videos to be put up.

One tiny nitpick, though. In the example about sorting lines in a file,
there was a syntax error in the code (missing '.' and the end of the
first/second line). I know, I know ... but it was distracting me from
what Walter was saying, my brain keeps going but there's a syntax
error! Is he going to talk about the syntax error? It's a syntax
error!... :-P


[...]
 I love the D-like line on the first slide. Kind of a strange API being
 used ;), but quintessentially D syntax. Cute :) The 100 lines of
 boilerplate bit was great too. Made me cheer even though no one else
 was around.
[...]

Yeah, pretty much sums up how I feel about IDEs. But OTOH, the question
at the end from the professor/lecturer proves that the majority of
today's coders expect IDEs. I would vote for better education, but you
can't deny the need for IDEs to at least smooth the transition from
other languages.

In any case, I totally agree that if a language *needs* an IDE in order
to cope with the amount of required boilerplate, then something is
clearly very, very wrong at a fundamental level. I guess that's why I'm
a D fan. :)


T

-- 
Food and laptops don't mix.


Re: DConf 2013 keynote

2013-05-10 Thread H. S. Teoh
On Fri, May 10, 2013 at 01:09:32PM +0200, deadalnix wrote:
[...]
 First good talk. Some tweaking can be done to make it better.
 
 One of them is the plane metaphor. I now know that Walter is a big
 fan of plane (and he knows quite a lot about that !) but the problem
 is that the point is very subjective (the plane want to fly).
 
 I'm sure the plane idea can be kept, but must be presented in a more
 factual/less subjective manner.

But the thing is, what constitutes good code *is* a subjective matter.
How do you define good code? Mathematically speaking, anything that
maps input into output correctly is equivalent, so a beautifully-written
piece-of-art code is no better, by this definition, than an IOCCC entry
that does exactly the same thing. But we'd never regard an IOCCC entry
as beautiful code by any stretch of the term (even if you were the
author -- I was, once, and it's exactly how Walter describes it: yes it
works, yes there were quite a few ingenious hacks in it, and yes it got
me the dubious honor of my code being featured on ioccc.org, but
afterwards I really just wanted to hide it away somewhere, sweep it
under the rug, etc.).

It's even more subjective when it comes to language design.
Mathematically speaking, the most beautiful language is the most concise
and expressive (and hence the most powerful). By that standard, we
should be programming with Lambda calculus -- after all, every
computation can be expressed by Lambda calculus, so why clutter the
language with redundant constructs? But clearly that's not what we're
doing here. The thing is, we're trying to map our human mental concepts
onto programming space in the nicest possible ways (rather than taking a
purely objective, mathematical approach, i.e., Lambda calculus or Turing
machines), and mental concepts, by definition, are subjective.


T

-- 
Be in denial for long enough, and one day you'll deny yourself of things you 
wish you hadn't.


Re: DConf 2013 keynote

2013-05-10 Thread Paulo Pinto

Am 10.05.2013 12:15, schrieb Andrej Mitrovic:

On 5/9/13, Nick Sabalausky seewebsitetocontac...@semitwist.com wrote:

On Thu, 09 May 2013 10:26:46 -0400
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:


On 5/9/13 10:26 AM, Andrei Alexandrescu wrote:

With all this focus on technicalities, we forgot to discuss the
gist of it: what did you guys think of the talk?


I liked the talk very much, although I preferred the 2007 talk where
both of you presented the talk together and allowed questions to be
asked during the presentation. Still I'm looking forward to the other
more technical presentations.

P.S. it seems the #dconf hashtag is being hijacked by another conference now:
https://twitter.com/GetApp/status/332770427296419841



I found that presentation the other day by accident. Quite interesting.

--
Paulo


Re: DConf 2013 keynote

2013-05-10 Thread Paulo Pinto

Am 10.05.2013 16:29, schrieb H. S. Teoh:

Yeah, pretty much sums up how I feel about IDEs. But OTOH, the question
at the end from the professor/lecturer proves that the majority of
today's coders expect IDEs. I would vote for better education, but you
can't deny the need for IDEs to at least smooth the transition from
other languages.


I grew up with IDEs, the first being Turbo Pascal 3.0 foloowed by quite 
many variations, including Smalltalk and Lisp environments.


Then I got my first contact with UNIX in 1994 with Xenix, followed by 
DG/UX. It was a shock! It felt to me as if I was still in 1970 using the 
original UNIX.





In any case, I totally agree that if a language *needs* an IDE in order
to cope with the amount of required boilerplate, then something is
clearly very, very wrong at a fundamental level. I guess that's why I'm
a D fan. :)


T



I think the same of any language that needs any form of tooling to make 
it better. For example, C requires lint+MISRA C to give the language the 
safety I get out of the box with D, Extended Pascal, Modula-2, Ada and 
similar.


--
Paulo


Where should the destruction of aggregate members take place?

2013-05-10 Thread Henning Pohl
a) In the so-called whole dtor which calls the dtors of all 
members including the dtor declared (if any). The attributes of 
the whole dtor are deduced.


b) Everything takes place in the dtor declared (if any). If the 
dtor is pure/nothrow/safe, it is guaranteed that the object can 
be destructed purely/without throwing/safely. This will break 
existing code.


-
struct S { ~this() { } }
struct SX { S s; pure ~this() { } }
-

a) Compiles.
b) Error: S.s.~this is impure

Both behaviors are available on github:
a) https://github.com/D-Programming-Language/dmd/pull/2006
b) https://github.com/D-Programming-Language/dmd/pull/2003

You can apply this to postblit, too.


Why can't templatized classes be aliased ?

2013-05-10 Thread KeyboardRider

with these simple types:

class Implementator1(T){}
class Implementator2(T){}
class Implementator3(T){}

version(1)
{
  class ChosenImplementator(T): Implementator1!T{}
}

version(2)
{
  class ChosenImplementator(T): Implementator3!T{}
}

version(All)
{
  class Foo(T)
  {
 ChosenImplementator!T Bar;
  }
}

Why isn't it possible, technically, to alias a template ?
(such like that:)

version(1)
{
  alias (Implementator1(T)) ChosenImplementator(T);
}

version(2)
{
  alias (Implementator2(T)) ChosenImplementator(T);
}

which would avoid to polute a templatized class with some 
compiler switches.

Would aliasing template make sense ?


Re: Why can't templatized classes be aliased ?

2013-05-10 Thread anonymous

On Friday, 10 May 2013 at 15:53:25 UTC, KeyboardRider wrote:

Why isn't it possible, technically, to alias a template ?
(such like that:)

version(1)
{
  alias (Implementator1(T)) ChosenImplementator(T);
}


alias Implementator1 ChosenImplementator;


Re: Where should the destruction of aggregate members take place?

2013-05-10 Thread Kenji Hara
2013/5/11 Henning Pohl henn...@still-hidden.de

 a) In the so-called whole dtor which calls the dtors of all members
 including the dtor declared (if any). The attributes of the whole dtor
 are deduced.

 b) Everything takes place in the dtor declared (if any). If the dtor is
 pure/nothrow/safe, it is guaranteed that the object can be destructed
 purely/without throwing/safely. This will break existing code.

 -
 struct S { ~this() { } }
 struct SX { S s; pure ~this() { } }
 -

 a) Compiles.
 b) Error: S.s.~this is impure

 Both behaviors are available on github:
 a) 
 https://github.com/D-**Programming-Language/dmd/pull/**2006https://github.com/D-Programming-Language/dmd/pull/2006
 b) 
 https://github.com/D-**Programming-Language/dmd/pull/**2003https://github.com/D-Programming-Language/dmd/pull/2003

 You can apply this to postblit, too.


Until 2.062, dmd has been behaved as a) for destructors, but current git
head is accidentally changed to b).
I think it is a regression.

Pull#2006 will change back the behavior to a), but pull#2003 doesn't.

Kenji Hara


Re: Why can't templatized classes be aliased ?

2013-05-10 Thread KeyboardRider

On Friday, 10 May 2013 at 15:57:48 UTC, anonymous wrote:

On Friday, 10 May 2013 at 15:53:25 UTC, KeyboardRider wrote:

Why isn't it possible, technically, to alias a template ?
(such like that:)

version(1)
{
 alias (Implementator1(T)) ChosenImplementator(T);
}


alias Implementator1 ChosenImplementator;


All right thx. Nothing else to add. ;)



Re: Åkerön: Demographics poll

2013-05-10 Thread Tyro[17]

On 5/10/13 10:17 AM, Steven Schveighoffer wrote:

On Thu, 09 May 2013 19:30:25 -0400, Tyro[17] nos...@home.com wrote:


http://www.akeron.co


Is that right?  Or is it akeron.com?

Both seem to be boilerplate web sites of just-registered domains.

-Steve


That's right. akeron.com is taken. Although... it's been in it's current 
state since 1994. I purchased akeron.co a couple days ago after making 
the decision it's time to start moving forward with my business.


--

Andrew Edwards


Re: D graph library

2013-05-10 Thread H. S. Teoh
On Wed, May 08, 2013 at 07:25:26PM +0200, Joseph Rushton Wakeling wrote:
 On 05/08/2013 06:12 PM, H. S. Teoh wrote:
  Hmm. Is it necessary to provide a random access ranges? For some
  graph algorithms that's necessary, but for others, it may not be.
 
 Agree that it's debatable.  It's probably desirable but not necessary.

I suppose we can make it an optional thing, such that algorithm A may
ask for only an InputRange (and a graph with bidirectional range of
nodes will still work) but algorithm B may ask for more, say a
ForwardRange or RandomAccessRange. Each algorithm will require the
minimum necessary to perform efficiently (though of course it can be
special-cased to take advantage of additional features of a higher
range, if that is available in a given instantiation).

In fact, now that I think of it... most of the features you listed can
arguably be optional: only a few algorithms (none that I know of,
actually) require enumeration of edges, some algorithms may only require
an input range of nodes, each of which gives an input range of edges,
etc.. Would it make sense to define a set of graph properties (e.g., via
templates ala std.range.is{Input,Forward,Bidirectional,...}Range, or
hasLength, hasSwappableElements, etc.), and have each algorithm require
whatever minimal subset of them is necessary to do the work? Because it
makes little sense to require, say, a graph that returns a total count
of nodes, if a given algorithm never needs to use that information
anyway. This way, a structure for which the total number of nodes is
expensive to compute can still be used with that algorithm.

IOW, we can have things like hasRandomAccessNodes, hasNodeCount,
hasEdgeCount, canEnumerateEdges, etc., and each algorithm will use a
subset of these in their signature constraints.


  Note also that both the above automatically define the count of
  nodes/edges, but we could of course add courtesy functions to give
  them directly.
  
  Something along the lines of std.range's .hasLength, I guess? Makes
  sense.
 
 If nodes() and edges() return a RandomAccessRanges then they will
 automatically have the .length property.  So you could add a courtesy
 function like nodecount() or edgecount() that in this case would just
 wrap nodes.length but for other cases might calculate the node or edge
 count in a different way.

Makes sense.


  Finally, a reasonable question is whether they should return ranges
  of actual nodes or edges, or ranges of node/edge IDs.
  
  I think the distinction is mostly superfluous. One could always wrap
  IDs in a struct
 
 Well, I was considering whether making it a range of IDs might be more
 flexible with respect to underlying data structures.  I may be falling
 into premature optimization here. :-)

Hmm. I'm undecided here until I see some actual algorithms in which this
choice makes a difference. I don't want to fall into premature
generalization here. ;-)


  Another thought I have is whether we should require a method that
  enumerates all edges. The number of edges in a graph can grow very
  quickly w.r.t. the number of nodes, and some graphs may be so
  complex that the edges can't all be stored in memory at once, but
  only computed per-node. In such cases, requiring edge enumeration
  may be counterproductive. I'm inclined towards leaving out edge
  enumeration unless some specific algorithms require it (even then,
  we could just make it a requirement for those particular
  algorithms). I admit my knowledge of graph algorithms is rather
  limited, but AFAIK none of them require edge enumeration on the
  entire graph.
 
 Well, if we accept that we're going to be offering the user a range
 that lists all edges, the underlying code might handle that in many
 different ways -- just reading from an array, cacheing input from a
 database, or whatever else is appropriate.  That shouldn't make it
 difficult to get the overall number of edges -- that's always going to
 be a stored number of one kind or another, whether it's an array
 length or a record of the number of fields in a database, or whatever.

Not if the graph is computed on-the-fly. E.g. chess analysis
applications in which the complete graph is infeasible to compute.


  Does it make sense to have a common interface between, say, directed
  and non-directed graphs? That is, are there algorithms that can
  operate on both, or do most of the interesting algorithms only work
  on one or the other? I'm just wondering if it's worth the trouble of
  doing compile-time (or runtime) checks if we could just have two
  unrelated graph types.
 
 Reasonable question.  As far as I can tell most graph libraries offer
 a broadly common interface even though the underlying data structure
 may vary quite a bit.
 
 The practical implementation of those checks might well be simply
 reading an immutable boolean variable in the graph type.

In that case, I wonder if it's even necessary to unify the two graph
types. Why not just have two separate 

Re: DConf 2013 keynote

2013-05-10 Thread Jonathan M Davis
On Thursday, May 09, 2013 17:32:18 Nick Sabalausky wrote:
 On Thu, 09 May 2013 10:26:46 -0400
 
 Andrei Alexandrescu seewebsiteforem...@erdani.org wrote:
  On 5/9/13 10:26 AM, Andrei Alexandrescu wrote:
   With all this focus on technicalities, we forgot to discuss the
   gist of it: what did you guys think of the talk?
  
  That should better go in the digitalmars.D group though...
 
 Very good talk! And good production quality, too. This would be a
 great thing to point people towards to introduce them to D.

Indeed.

 And Walter does a good job on stage. *Never* comes across as
 pretentious, or cocky or full-of-...various things...like *cough*a
 certain former Apple leader*cough* always did.

Walter may be very stubborn and opinionated, but he definitely isn't 
pretentious.

- Jonathan M Davis


Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Jesse Phillips

On Friday, 10 May 2013 at 11:00:08 UTC, Jacob Carlborg wrote:
Github can handle this. You can assign people to a pull request 
and add labels to indicate different statuses or whatever you 
want them to mean. At least I think you can add labels to pull 
requests. I don't currently have any open pull request for any 
of my projects so I cannot test it.


I believe only issues could have labels applied. Which is fine 
for those using issues since the pull will create an issue.


Re: Why can't templatized classes be aliased ?

2013-05-10 Thread Daniel Murphy
KeyboardRider keyboardri...@nowhere.com wrote in message 
news:vabffcdkuarjzbsiv...@forum.dlang.org...
 with these simple types:

 class Implementator1(T){}
 class Implementator2(T){}
 class Implementator3(T){}

 version(1)
 {
   class ChosenImplementator(T): Implementator1!T{}
 }

 version(2)
 {
   class ChosenImplementator(T): Implementator3!T{}
 }

 version(All)
 {
   class Foo(T)
   {
  ChosenImplementator!T Bar;
   }
 }

 Why isn't it possible, technically, to alias a template ?
 (such like that:)

 version(1)
 {
   alias (Implementator1(T)) ChosenImplementator(T);
 }

 version(2)
 {
   alias (Implementator2(T)) ChosenImplementator(T);
 }

 which would avoid to polute a templatized class with some compiler 
 switches.
 Would aliasing template make sense ?

Or even

template ChosenImplementator(T) { alias ChosenImplementator = 
Implementator1!T; } 




Re: DConf 2013 keynote

2013-05-10 Thread Walter Bright

On 5/10/2013 4:09 AM, deadalnix wrote:

One of them is the plane metaphor. I now know that Walter is a big fan of plane
(and he knows quite a lot about that !) but the problem is that the point is
very subjective (the plane want to fly).


It's not that subjective. An airplane that wants to fly is well known among 
airplane designers and pilots. All you have to do is point it down the runway 
and open the throttle. It will take off and fly straight and level without any 
hands on the controls. An airplane can also endure grevious damage, and still fly.


A helicopter, on the other hand, wants to crash. It requires constant active 
efforts to keep it in the air, and if much of anything goes wrong, it will crash 
and kill you.


Have you ever driven a high performance car that wants to go? I have. The car 
clearly isn't happy being driven slowly and gently. It's only happy when your 
right foot is mashed all the way down :-)


Re: DConf 2013 keynote

2013-05-10 Thread Andrej Mitrovic
On 5/10/13, H. S. Teoh hst...@quickfur.ath.cx wrote:
 One tiny nitpick, though. In the example about sorting lines in a file,
 there was a syntax error in the code (missing '.' and the end of the
 first/second line).

Walter already used these slides for a previous talk where the missing
dot was mentioned during the talk. He probably just forgot to update
the pdf. :)

Actually that previous talk was a little bit more descriptive in what
the code does (and people kept asking questions too). I'm not sure
exactly what talk it was, maybe it was on nwcpp..


Re: DConf 2013 keynote

2013-05-10 Thread sk
In any case, I totally agree that if a language *needs* an IDE 
in order to cope with the amount of required boilerplate, then 
something is clearly very, very wrong at a fundamental level.


May be this is true for expert or professional programmers. But 
for people like me who only use D occasionally an IDE is a must.


IDE mainly helps me in reducing the amount of things I need to 
memorize or remember like API, building tool names, command 
syntaxes, etc. This is very important as my main profession is 
not programming.


I think lack of IDEs will prevent many beginners from trying out 
a new language. Especially after getting spoiled with IDEs like 
netbeans, visual studio etc.


Currently using DIDE, not perfect but better than nothing. 
VisualD seems to have good reviews but I cannot install it as it 
requires admin privileges.


All the above will still be true even for a perfect programming 
language.


Re: DConf 2013 keynote

2013-05-10 Thread Daniel Murphy
deadalnix deadal...@gmail.com wrote in message 
news:mtmtakrebylsdehnr...@forum.dlang.org...

 First good talk. Some tweaking can be done to make it better.

 One of them is the plane metaphor. I now know that Walter is a big fan of 
 plane (and he knows quite a lot about that !) but the problem is that the 
 point is very subjective (the plane want to fly).

 I'm sure the plane idea can be kept, but must be presented in a more 
 factual/less subjective manner.


Forget planes, this code quite obviously wants to fly! 
http://www.ioccc.org/1998/banks.c 




Re: DConf 2013 keynote

2013-05-10 Thread Nick Sabalausky
On Fri, 10 May 2013 21:55:57 +0200
sk abcd...@gmail.com wrote:

  In any case, I totally agree that if a language *needs* an IDE 
  in order to cope with the amount of required boilerplate, then 
  something is clearly very, very wrong at a fundamental level.
 
 May be this is true for expert or professional programmers. But 
 for people like me who only use D occasionally an IDE is a must.
 
 IDE mainly helps me in reducing the amount of things I need to 
 memorize or remember like API, building tool names, command 
 syntaxes, etc. This is very important as my main profession is 
 not programming.
 
 I think lack of IDEs will prevent many beginners from trying out 
 a new language. Especially after getting spoiled with IDEs like 
 netbeans, visual studio etc.
 
 Currently using DIDE, not perfect but better than nothing. 
 VisualD seems to have good reviews but I cannot install it as it 
 requires admin privileges.
 
 All the above will still be true even for a perfect programming 
 language.

While that's all true, none of it really contradicts what was said. Ie,
that The IDE can auto-generate boilerplate is a very poor excuse for a
language to lack ways of minimizing the need for boilerplate in the
first place.



Re: I want to add a Phobos module with template mixins for common idioms.

2013-05-10 Thread Idan Arye

On Wednesday, 8 May 2013 at 20:11:34 UTC, Idan Arye wrote:
OK, so I'm gonna go ahead and implement it, so I can show by 
example that the string solution can be typesafe, scalable and 
elegant.


OK, this is a basic implementation:
https://gist.github.com/someboddy/5557358

Before I can make the pull request, I still need to do 
documentation, add some asserts to make sure users don't declare 
methods or subtypes in the property declarations string, add some 
more unit tests, and add the other idiom(the singleton).


But, it's still enough for demonstrating that strings are not 
evil, and that their usage here does not brake type safety, 
scope, or anything else.


Re: DConf 2013 keynote

2013-05-10 Thread sk

Ah, makes sense, sorry for the misunderstanding.


Re: DConf 2013 keynote

2013-05-10 Thread H. S. Teoh
On Fri, May 10, 2013 at 09:55:57PM +0200, sk wrote:
 In any case, I totally agree that if a language *needs* an IDE in
 order to cope with the amount of required boilerplate, then
 something is clearly very, very wrong at a fundamental level.
 
 May be this is true for expert or professional programmers. But for
 people like me who only use D occasionally an IDE is a must.

My point was that while an IDE is helpful (e.g. for people who aren't
professional programmers, just want to get the job done, etc.), a
language should not *depend* on an IDE to insert boilerplate. I concede
that IDEs are helpful and needed for newbies and non-professional
programmers, but the *language* itself should be usable without one.
Requiring one because otherwise the amount of required boilerplate would
be unmanagable, is a symptom that there is something wrong with the
language's design.


[...]
 I think lack of IDEs will prevent many beginners from trying out a
 new language. Especially after getting spoiled with IDEs like
 netbeans, visual studio etc.
[...]

Agreed. But my point was that the language shouldn't *depend* on an IDE
in order to be usable. If a language requires an IDE because you need to
insert 100 lines of boilerplate in every program you write, then one has
to wonder, why not make those 100 lines *implicit*? They are not
conveying anything useful about the program, because they will be
identical (or mostly identical) every single time. The fact that the
language did *not* make it implicit then begs the question of what went
wrong in its design that you have to repeatedly specify what should
already be obvious to the language/compiler.

As they say in information theory: it is the stuff that stands out, that
is different from the rest, that carries the most information. The stuff
that's pretty much repeated every single time conveys very little
information. This is why newspaper headings tend to leave out very
common words like the, a, is, etc., because these words take up
space but convey little to no additional information -- you can drop
them and still get the gist of what the headlines are saying.

A good programming language is one where the code says all the important
things, and leaves out most of the unimportant or obvious things. It's
just like Walter said in the talk: the file-reading function without
scope guards was full of goto's and error-checking, stuff that pretty
much is (or should be) done everywhere. It clutters the code and
obscures the salient points. It's a headline with all the the's,
a's, is's. In contrast, the version with scope guards can be read
sequentially -- all the peripheral if's and goto's are nicely abstracted
away, leaving only the salient points of the code: allocate a buffer,
read the data, return the data. A glance at the code immediately tells
you its key points. No distracting sidelines of error-checking, goto's,
labels, or any of that nonsense.

In contrast, consider a language like C. The *correct* way of writing C
code is something like this:

int myfunc(struct A *a, struct B *b, struct C *c) {
/* Boilerplate: to avoid slip-ups with uninitialized
 * pointers, must always set them to NULL. */
void *buf = NULL;
struct D *d = NULL;

/* Boilerplate: check for NULL pointers */
if (!a || !b || !c)
/* Boilerplate: everybody and their neighbour's
 * dog defines their own set of macros for
 * return values; how do you remember which one
 * goes with which function(s)? */
return INVALID_ARGS_ERROR;

buf = malloc(some_size);

/* Boilerplate: must check NULL return from malloc,
 * every single time. */
if (!buf)
return MEMORY_ERROR;

/* Boilerplate: every function call must be wrapped in
 * an if-goto, because the function may have returned an
 * error. */
if (anotherfunc(a, buf) != OK)
goto ERROR;

/* And yes, technically, you need to do this for things
 * like printf too! Guess how many C coders do this?
 * That's right, nobody does. It's wrong, and leads to
 * hilarious problems when stdout isn't pointing to what
 * the programmer thought it was. Or not-so-hilarious,
 * if stdout was closed and a database handle was
 * reopened and reused stdout's file descriptor
 * number...
 */
if (printf(Hello, world!\n) != 0)
goto ERROR;

/* More boilerplate */
if ((d = create_instance_of_d()) == NULL)
goto ERROR;

/* Now our boilerplate needs to 

Re: D pull request review process -- strawman formal definition, query for tools

2013-05-10 Thread Jacob Carlborg

On 2013-05-10 20:10, Jesse Phillips wrote:


I believe only issues could have labels applied. Which is fine for those
using issues since the pull will create an issue.


But currently issues are disabled.

--
/Jacob Carlborg


Re: DConf 2013 keynote

2013-05-10 Thread Walter Bright

On 5/10/2013 2:31 PM, H. S. Teoh wrote:

Note how much boilerplate is necessary to make the code work
*correctly*.


It's worse than that. Experience shows that this rat's nest style of code often 
is incorrect because it is both complex and never tested. While D doesn't make 
it more testable, at least it makes it simple, and hence more likely to be correct.


A sick joke!

2013-05-10 Thread Tyro[17]
I love the occasional self-inflicted wound just like the other 
guy. So today I decided to enjoy one... Only to descover that  
it's not as much fun as I thought it would be. And now, I'm in a 
world of hurt.


I enabled the Colemak layout and decided to learn how to type on 
it. Except the lack of sleep cought up to me and when I woke up 
the screen was locked. Since I only learned four of the key 
positions before falling asleep, I have a seriousness problem 
unlocking the computer.


The bigger issue is that the computer was manufactured for use in 
Japan so the keys are arranged differently that traditional 
english keyboards. I can find many layouts of the Colemak 
keyboard on the Internet but none for a Japanese keyboard. Can 
anyone posessing one of these computers help me document the 
Colemak layout please? I believe it is already installed on the 
Mac but is not enabled. If not, download and installation 
instructions can be found here: 
colemak.com/wiki/index.php?title=Mac


Thanks,
Andrew


Re: DConf 2013 keynote

2013-05-10 Thread Jonathan M Davis
On Friday, May 10, 2013 14:31:00 H. S. Teoh wrote:
 As they say in information theory: it is the stuff that stands out, that
 is different from the rest, that carries the most information. The stuff
 that's pretty much repeated every single time conveys very little
 information.

This is an excellent way of looking at language design (and program design for 
that matter).

- Jonathan M Davis


  1   2   >