www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Slides from my ACCU Silicon Valley talk

reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Compared to the talk at Google, I changed one of the "cool things" from 
threading to operator overloading. Didn't manage to talk about that - 
there were a million questions - although I think it's a great topic.

http://erdani.com/tdpl/2010-12-08-ACCU.pdf


Andrei
Dec 12 2010
next sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool things" from 
 threading to operator overloading. Didn't manage to talk about that - 
 there were a million questions - although I think it's a great topic.
 
 http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Dec 12 2010
next sibling parent reply "Simen kjaeraas" <simen.kjaras gmail.com> writes:
Walter Bright <newshound2 digitalmars.com> wrote:

 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool things" from  
 threading to operator overloading. Didn't manage to talk about that -  
 there were a million questions - although I think it's a great topic.
  http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Done. http://www.reddit.com/r/programming/comments/eklq0/andrei_alexandrescus_talk_at_accu_silicon_valley/ -- Simen
Dec 12 2010
parent reply Gary Whatmore <no spam.sp> writes:
Simen kjaeraas Wrote:

 Walter Bright <newshound2 digitalmars.com> wrote:
 
 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool things" from  
 threading to operator overloading. Didn't manage to talk about that -  
 there were a million questions - although I think it's a great topic.
  http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Done. http://www.reddit.com/r/programming/comments/eklq0/andrei_alexandrescus_talk_at_accu_silicon_valley/
Guys, I made several sockpuppet reddit accounts to mod down the two guys criticising this thread. I recommend everyone to help us improve D's publicity by ignoring these trolls and voting them down. It has worked before, too -- reddit seems to fold the subthreads that get too many negative votes. This makes it look much better than it is. - G.W.
Dec 12 2010
next sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/12/10 8:56 PM, Gary Whatmore wrote:
 Simen kjaeraas Wrote:

 Walter Bright<newshound2 digitalmars.com>  wrote:

 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool things" from
 threading to operator overloading. Didn't manage to talk about that -
 there were a million questions - although I think it's a great topic.
   http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Done. http://www.reddit.com/r/programming/comments/eklq0/andrei_alexandrescus_talk_at_accu_silicon_valley/
Guys, I made several sockpuppet reddit accounts to mod down the two guys criticising this thread. I recommend everyone to help us improve D's publicity by ignoring these trolls and voting them down. It has worked before, too -- reddit seems to fold the subthreads that get too many negative votes. This makes it look much better than it is.
I think at best we focus on providing good information. One problem with nay-saying is that, when half-competent, provides misinformation. Andrei
Dec 12 2010
prev sibling next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
I was away for few days and then partially busy for several more days, I am
sorry and I will try to get up to date.

Gary Whatmore:

 Guys, I made several sockpuppet reddit accounts to mod down the two guys
criticising this thread.<
That's worse than desiring to add some examples of D code to Wikipedia, I was criticized about :-) ------------------- One of the comments of the Reddit thread seems a bit interesting: nullc:
When I first read about D I was hoping that they'd limit overloads to pure
functions, a substantial decrease in the maximum riskyness/surprise-factor of
an overload hidden operation.<
Is requiring the Operator Overloading member functions to be pure a good idea? Bye, bearophile
Dec 12 2010
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Sunday 12 December 2010 23:20:36 bearophile wrote:
 I was away for few days and then partially busy for several more days, I am
 sorry and I will try to get up to date.
 
 Gary Whatmore:
 Guys, I made several sockpuppet reddit accounts to mod down the two guys
 criticising this thread.<
That's worse than desiring to add some examples of D code to Wikipedia, I was criticized about :-) ------------------- One of the comments of the Reddit thread seems a bit interesting: nullc:
When I first read about D I was hoping that they'd limit overloads to pure
functions, a substantial decrease in the maximum
riskyness/surprise-factor of an overload hidden operation.<
Is requiring the Operator Overloading member functions to be pure a good idea?
Absolutely not. I don't see what that poster thought would be gained by enforcing that, but it's _really_ easy to have useful and legitimate overloaded operators which can't be pure. Purity has its uses, but I think that that poster is overestimating them if they think that requiring overloaded operators to be pure would be generally useful, let alone solve much in the way of problems. - Jonathan M Davis
Dec 12 2010
prev sibling parent reply snk_kid <korcan_h hotmail.com> writes:
Gary Whatmore Wrote:

 Simen kjaeraas Wrote:
 
 Walter Bright <newshound2 digitalmars.com> wrote:
 
 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool things" from  
 threading to operator overloading. Didn't manage to talk about that -  
 there were a million questions - although I think it's a great topic.
  http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Done. http://www.reddit.com/r/programming/comments/eklq0/andrei_alexandrescus_talk_at_accu_silicon_valley/
Guys, I made several sockpuppet reddit accounts to mod down the two guys >criticising this thread. I recommend everyone to help us improve D's publicity by >ignoring these trolls and voting them down. It has worked before, too -- reddit >seems to fold the subthreads that get too many negative votes. This makes it >look much better than it is. - G.W.
That's absolutely pathetic, you're actually doing the community a disservice.
Dec 13 2010
parent reply retard <re tard.com.invalid> writes:
Mon, 13 Dec 2010 14:44:36 -0500, snk_kid wrote:

 Gary Whatmore Wrote:
 
 Simen kjaeraas Wrote:
 
 Walter Bright <newshound2 digitalmars.com> wrote:
 
 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool things"
 from threading to operator overloading. Didn't manage to talk
 about that - there were a million questions - although I think
 it's a great topic.
  http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Done. http://www.reddit.com/r/programming/comments/eklq0/
andrei_alexandrescus_talk_at_accu_silicon_valley/
 
 Guys, I made several sockpuppet reddit accounts to mod down the two
 guys >criticising this thread. I recommend everyone to help us improve
 D's publicity by >ignoring these trolls and voting them down. It has
 worked before, too -- reddit >seems to fold the subthreads that get too
 many negative votes. This makes it >look much better than it is.
 
  - G.W.
That's absolutely pathetic, you're actually doing the community a disservice.
I really don't know what to say. Take a look at 0 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18swbi or -1 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18sz8n These say nothing against D. Why does one take them personally? They are both also highly informative. As far as I can tell, these two comments go much deeper in operator semantics theory than the combined effort of 68 other threads by Walter, Andrei et al. For example the precedence of operators can get problematic when using several libraries from various vendors. Then you have: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18t1d5 "I really like D (2.0) and I wish it would take off." 7 points? WTF? What is the value of this reply? It's a purely subjective opinion and doesn't necessarily even beg for further discussion.
Dec 13 2010
parent reply Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Why do /you/ take it personally?

On 12/14/10, retard <re tard.com.invalid> wrote:
 Mon, 13 Dec 2010 14:44:36 -0500, snk_kid wrote:

 Gary Whatmore Wrote:

 Simen kjaeraas Wrote:

 Walter Bright <newshound2 digitalmars.com> wrote:

 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool things"
 from threading to operator overloading. Didn't manage to talk
 about that - there were a million questions - although I think
 it's a great topic.
  http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Done. http://www.reddit.com/r/programming/comments/eklq0/
andrei_alexandrescus_talk_at_accu_silicon_valley/
 Guys, I made several sockpuppet reddit accounts to mod down the two
 guys >criticising this thread. I recommend everyone to help us improve
 D's publicity by >ignoring these trolls and voting them down. It has
 worked before, too -- reddit >seems to fold the subthreads that get too
 many negative votes. This makes it >look much better than it is.

  - G.W.
That's absolutely pathetic, you're actually doing the community a disservice.
I really don't know what to say. Take a look at 0 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18swbi or -1 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18sz8n These say nothing against D. Why does one take them personally? They are both also highly informative. As far as I can tell, these two comments go much deeper in operator semantics theory than the combined effort of 68 other threads by Walter, Andrei et al. For example the precedence of operators can get problematic when using several libraries from various vendors. Then you have: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18t1d5 "I really like D (2.0) and I wish it would take off." 7 points? WTF? What is the value of this reply? It's a purely subjective opinion and doesn't necessarily even beg for further discussion.
Dec 13 2010
parent reply retard <re tard.com.invalid> writes:
Tue, 14 Dec 2010 02:56:45 +0100, Andrej Mitrovic wrote:

 Why do /you/ take it personally?
You've misunderstood. I only wish the discussion was a bit more technical and had less to do with opinions and hype. The reason is, a more technical approach might solve technical problems in more efficient way. But my goal is not to belittle social issues wrt language adoption. Surely I understand reddit isn't lambda-the-ultimate.org and I'm glad that the Go trolls didn't find the thread (yet). I just find this behavior incomprehensible. My personal stance on this matter is that I believe a more consistent and flexible mechanism for operators would fit D. I'm also a bit more of a fan of C++0x concepts than those contraints shown in the slides. I haven't really thought how it all would work out, but if the atmosphere was more ambitious to this direction, I could participate more. But it seems my vision conflicts badly with what D2 has become.
 
 On 12/14/10, retard <re tard.com.invalid> wrote:
 Mon, 13 Dec 2010 14:44:36 -0500, snk_kid wrote:

 Gary Whatmore Wrote:

 Simen kjaeraas Wrote:

 Walter Bright <newshound2 digitalmars.com> wrote:

 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool
 things" from threading to operator overloading. Didn't manage to
 talk about that - there were a million questions - although I
 think it's a great topic.
  http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Done. http://www.reddit.com/r/programming/comments/eklq0/
andrei_alexandrescus_talk_at_accu_silicon_valley/
 Guys, I made several sockpuppet reddit accounts to mod down the two
 guys >criticising this thread. I recommend everyone to help us
 improve D's publicity by >ignoring these trolls and voting them down.
 It has worked before, too -- reddit >seems to fold the subthreads
 that get too many negative votes. This makes it >look much better
 than it is.

  - G.W.
That's absolutely pathetic, you're actually doing the community a disservice.
I really don't know what to say. Take a look at 0 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18swbi or -1 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18sz8n These say nothing against D. Why does one take them personally? They are both also highly informative. As far as I can tell, these two comments go much deeper in operator semantics theory than the combined effort of 68 other threads by Walter, Andrei et al. For example the precedence of operators can get problematic when using several libraries from various vendors. Then you have: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18t1d5 "I really like D (2.0) and I wish it would take off." 7 points? WTF? What is the value of this reply? It's a purely subjective opinion and doesn't necessarily even beg for further discussion.
Dec 13 2010
next sibling parent reply lurker <lurk lurk.net> writes:
Why don't you retard, I mean eternium, I mean iLikeCakes, I mean snk_kid, I
mean WeAreAllTreeBear, I mean bearophile's alter ego, go someplace else.
Waisting time here is really not worth it. They provide psychiatric treatment
in hospitals. I can't prove this conspiracy easily, but I also voted down your
stupid remarks there. I hope this teaches you a lesson.

retard Wrote:

 Tue, 14 Dec 2010 02:56:45 +0100, Andrej Mitrovic wrote:
 
 Why do /you/ take it personally?
You've misunderstood. I only wish the discussion was a bit more technical and had less to do with opinions and hype. The reason is, a more technical approach might solve technical problems in more efficient way. But my goal is not to belittle social issues wrt language adoption. Surely I understand reddit isn't lambda-the-ultimate.org and I'm glad that the Go trolls didn't find the thread (yet). I just find this behavior incomprehensible. My personal stance on this matter is that I believe a more consistent and flexible mechanism for operators would fit D. I'm also a bit more of a fan of C++0x concepts than those contraints shown in the slides. I haven't really thought how it all would work out, but if the atmosphere was more ambitious to this direction, I could participate more. But it seems my vision conflicts badly with what D2 has become.
 
 On 12/14/10, retard <re tard.com.invalid> wrote:
 Mon, 13 Dec 2010 14:44:36 -0500, snk_kid wrote:

 Gary Whatmore Wrote:

 Simen kjaeraas Wrote:

 Walter Bright <newshound2 digitalmars.com> wrote:

 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool
 things" from threading to operator overloading. Didn't manage to
 talk about that - there were a million questions - although I
 think it's a great topic.
  http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Done. http://www.reddit.com/r/programming/comments/eklq0/
andrei_alexandrescus_talk_at_accu_silicon_valley/
 Guys, I made several sockpuppet reddit accounts to mod down the two
 guys >criticising this thread. I recommend everyone to help us
 improve D's publicity by >ignoring these trolls and voting them down.
 It has worked before, too -- reddit >seems to fold the subthreads
 that get too many negative votes. This makes it >look much better
 than it is.

  - G.W.
That's absolutely pathetic, you're actually doing the community a disservice.
I really don't know what to say. Take a look at 0 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18swbi or -1 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18sz8n These say nothing against D. Why does one take them personally? They are both also highly informative. As far as I can tell, these two comments go much deeper in operator semantics theory than the combined effort of 68 other threads by Walter, Andrei et al. For example the precedence of operators can get problematic when using several libraries from various vendors. Then you have: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18t1d5 "I really like D (2.0) and I wish it would take off." 7 points? WTF? What is the value of this reply? It's a purely subjective opinion and doesn't necessarily even beg for further discussion.
Dec 13 2010
next sibling parent Andrew Wiley <debio264 gmail.com> writes:
On Mon, Dec 13, 2010 at 8:50 PM, lurker <lurk lurk.net> wrote:
 Why don't you retard, I mean eternium, I mean iLikeCakes, I mean snk_kid,
I mean WeAreAllTreeBear, I mean bearophile's alter ego, go someplace else. Waisting time here is really not worth it. They provide psychiatric treatment in hospitals. I can't prove this conspiracy easily, but I also voted down your stupid remarks there. I hope this teaches you a lesson. +----------+ | PLEASE | | DO NOT | | FEED THE | | TROLLS | +----------+ | | | | .\|.||/.. Also, it's spelled "wasting."
Dec 13 2010
prev sibling next sibling parent "Yao G." <yao.gomez spam.gmail.com> writes:
On Mon, 13 Dec 2010 20:50:43 -0600, lurker <lurk lurk.net> wrote:

 Why don't you retard, I mean eternium, I mean iLikeCakes, I mean  
 snk_kid, I mean WeAreAllTreeBear, I mean bearophile's alter ego, go  
 someplace else. Waisting time here is really not worth it. They provide  
 psychiatric treatment in hospitals. I can't prove this conspiracy  
 easily, but I also voted down your stupid remarks there. I hope this  
 teaches you a lesson.

 retard Wrote:

 Tue, 14 Dec 2010 02:56:45 +0100, Andrej Mitrovic wrote:

 Why do /you/ take it personally?
You've misunderstood. I only wish the discussion was a bit more technical and had less to do with opinions and hype. The reason is, a more technical approach might solve technical problems in more efficient way. But my goal is not to belittle social issues wrt language adoption. Surely I understand reddit isn't lambda-the-ultimate.org and I'm glad that the Go trolls didn't find the thread (yet). I just find this behavior incomprehensible. My personal stance on this matter is that I believe a more consistent and flexible mechanism for operators would fit D. I'm also a bit more of a fan of C++0x concepts than those contraints shown in the slides. I haven't really thought how it all would work out, but if the atmosphere was more ambitious to this direction, I could participate more. But it seems my vision conflicts badly with what D2 has become.
 On 12/14/10, retard <re tard.com.invalid> wrote:
 Mon, 13 Dec 2010 14:44:36 -0500, snk_kid wrote:

 Gary Whatmore Wrote:

 Simen kjaeraas Wrote:

 Walter Bright <newshound2 digitalmars.com> wrote:

 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool
 things" from threading to operator overloading. Didn't manage  
to
 talk about that - there were a million questions - although I
 think it's a great topic.
  http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit
programming?
 Done.

 http://www.reddit.com/r/programming/comments/eklq0/
andrei_alexandrescus_talk_at_accu_silicon_valley/
 Guys, I made several sockpuppet reddit accounts to mod down the two
 guys >criticising this thread. I recommend everyone to help us
 improve D's publicity by >ignoring these trolls and voting them  
down.
 It has worked before, too -- reddit >seems to fold the subthreads
 that get too many negative votes. This makes it >look much better
 than it is.

  - G.W.
That's absolutely pathetic, you're actually doing the community a disservice.
I really don't know what to say. Take a look at 0 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18swbi or -1 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18sz8n These say nothing against D. Why does one take them personally? They are both also highly informative. As far as I can tell, these two comments go much deeper in operator semantics theory than the
combined
 effort of 68 other threads by Walter, Andrei et al. For example the
 precedence of operators can get problematic when using several
 libraries from various vendors.

 Then you have:

 http://www.reddit.com/r/programming/comments/eklq0/
 andrei_alexandrescus_talk_at_accu_silicon_valley/c18t1d5

 "I really like D (2.0) and I wish it would take off."

 7 points? WTF? What is the value of this reply? It's a purely
 subjective opinion and doesn't necessarily even beg for further
 discussion.
Oh, retard using sockpuppets. Business as usual. :) -- Yao G.
Dec 13 2010
prev sibling parent reply snk_kid <letrevio guerrillamailblock.com> writes:
None of those usernames are mine except this one (snk_kid). You need to stop
making assumptions and nobody really cares about a comment voting system. You
come off as a child making such an unprofessional post in a public mailing list
of a programming language. Is this what the D community is about? I've never
seen anything like it before, its pathetic.

lurker Wrote:
 Why don't you retard, I mean eternium, I mean iLikeCakes, I mean snk_kid, I
mean WeAreAllTreeBear, I mean bearophile's alter ego, go someplace else.
Waisting time here is really not worth it. They provide psychiatric treatment
in hospitals. I can't prove this conspiracy easily, but I also voted down your
stupid remarks there. I hope this teaches you a lesson.
 
 retard Wrote:
 
 Tue, 14 Dec 2010 02:56:45 +0100, Andrej Mitrovic wrote:
 
 Why do /you/ take it personally?
You've misunderstood. I only wish the discussion was a bit more technical and had less to do with opinions and hype. The reason is, a more technical approach might solve technical problems in more efficient way. But my goal is not to belittle social issues wrt language adoption. Surely I understand reddit isn't lambda-the-ultimate.org and I'm glad that the Go trolls didn't find the thread (yet). I just find this behavior incomprehensible. My personal stance on this matter is that I believe a more consistent and flexible mechanism for operators would fit D. I'm also a bit more of a fan of C++0x concepts than those contraints shown in the slides. I haven't really thought how it all would work out, but if the atmosphere was more ambitious to this direction, I could participate more. But it seems my vision conflicts badly with what D2 has become.
 
 On 12/14/10, retard <re tard.com.invalid> wrote:
 Mon, 13 Dec 2010 14:44:36 -0500, snk_kid wrote:

 Gary Whatmore Wrote:

 Simen kjaeraas Wrote:

 Walter Bright <newshound2 digitalmars.com> wrote:

 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool
 things" from threading to operator overloading. Didn't manage to
 talk about that - there were a million questions - although I
 think it's a great topic.
  http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Done. http://www.reddit.com/r/programming/comments/eklq0/
andrei_alexandrescus_talk_at_accu_silicon_valley/
 Guys, I made several sockpuppet reddit accounts to mod down the two
 guys >criticising this thread. I recommend everyone to help us
 improve D's publicity by >ignoring these trolls and voting them down.
 It has worked before, too -- reddit >seems to fold the subthreads
 that get too many negative votes. This makes it >look much better
 than it is.

  - G.W.
That's absolutely pathetic, you're actually doing the community a disservice.
I really don't know what to say. Take a look at 0 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18swbi or -1 points: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18sz8n These say nothing against D. Why does one take them personally? They are both also highly informative. As far as I can tell, these two comments go much deeper in operator semantics theory than the combined effort of 68 other threads by Walter, Andrei et al. For example the precedence of operators can get problematic when using several libraries from various vendors. Then you have: http://www.reddit.com/r/programming/comments/eklq0/ andrei_alexandrescus_talk_at_accu_silicon_valley/c18t1d5 "I really like D (2.0) and I wish it would take off." 7 points? WTF? What is the value of this reply? It's a purely subjective opinion and doesn't necessarily even beg for further discussion.
Dec 14 2010
parent reply "Nick Sabalausky" <a a.a> writes:
"snk_kid" <letrevio guerrillamailblock.com> wrote in message 
news:ie8gst$tta$1 digitalmars.com...
 None of those usernames are mine except this one (snk_kid). You need to 
 stop making assumptions and nobody really cares about a comment voting 
 system. You come off as a child making such an unprofessional post in a 
 public mailing list of a programming language. Is this what the D 
 community is about? I've never seen anything like it before, its pathetic.
lurker was just trolling. Like Andrew's sign indicated, best not to feed them.
Dec 14 2010
parent reply lurker <lurk lurk.net> writes:
Nick Sabalausky Wrote:

 "snk_kid" <letrevio guerrillamailblock.com> wrote in message 
 news:ie8gst$tta$1 digitalmars.com...
 None of those usernames are mine except this one (snk_kid). You need to 
 stop making assumptions and nobody really cares about a comment voting 
 system. You come off as a child making such an unprofessional post in a 
 public mailing list of a programming language. Is this what the D 
 community is about? I've never seen anything like it before, its pathetic.
lurker was just trolling. Like Andrew's sign indicated, best not to feed them.
I see, now defending D is considered trolling. Something tells me this Nick is actually snc_kid.
Dec 14 2010
parent "Nick Sabalausky" <a a.a> writes:
"lurker" <lurk lurk.net> wrote in message 
news:ie8r60$276r$1 digitalmars.com...
 Nick Sabalausky Wrote:

 "snk_kid" <letrevio guerrillamailblock.com> wrote in message
 news:ie8gst$tta$1 digitalmars.com...
 None of those usernames are mine except this one (snk_kid). You need to
 stop making assumptions and nobody really cares about a comment voting
 system. You come off as a child making such an unprofessional post in a
 public mailing list of a programming language. Is this what the D
 community is about? I've never seen anything like it before, its 
 pathetic.
lurker was just trolling. Like Andrew's sign indicated, best not to feed them.
I see, now defending D is considered trolling. Something tells me this Nick is actually snc_kid.
(Against my better judgement, I'll respond this time...) 1. Since when do personal flames and random baseless accusations count as "defending D"? 2. If you're convinced I'm snc_kid, go ahead and call my bluff: dig into IPs, logs, whatever, and present your evidence. We've had sockpuppet trolls here before who were easily proved to be the same person. If I'm one, put me in my place.
Dec 14 2010
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 12/14/10, retard <re tard.com.invalid> wrote:
 My personal stance on this matter is that I believe a more consistent and
 flexible mechanism for operators would fit D. I'm also a bit more of a
 fan of C++0x concepts than those contraints shown in the slides. I
 haven't really thought how it all would work out, but if the atmosphere
 was more ambitious to this direction, I could participate more.
You can always open up a new topic and discuss possible new features and/or changes for D.
Dec 13 2010
prev sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/13/10 8:30 PM, retard wrote:
 Tue, 14 Dec 2010 02:56:45 +0100, Andrej Mitrovic wrote:

 Why do /you/ take it personally?
You've misunderstood. I only wish the discussion was a bit more technical and had less to do with opinions and hype. The reason is, a more technical approach might solve technical problems in more efficient way. But my goal is not to belittle social issues wrt language adoption. Surely I understand reddit isn't lambda-the-ultimate.org and I'm glad that the Go trolls didn't find the thread (yet). I just find this behavior incomprehensible.
Well a reddit discussion is a reddit discussion opened to all flaws of reddit's voting system. No need to get annoyed over it. I enjoy reading snc_kid's posts, clearly knows the book. If anything I'd want snc_kid to hang out more around here and provide good criticism. Generally I'd much wish D's naysayers were simply of better quality; the likes of iLiekCaeks and eternium are just not all that competent.
 My personal stance on this matter is that I believe a more consistent and
 flexible mechanism for operators would fit D.
That would be interesting. In the best-case scenario, what do you think would be the positive impact of the flexible operators, as you envision them, on the language?
 I'm also a bit more of a
 fan of C++0x concepts than those contraints shown in the slides. I
 haven't really thought how it all would work out, but if the atmosphere
 was more ambitious to this direction, I could participate more. But it
 seems my vision conflicts badly with what D2 has become.
In all honesty, it is difficult to infer your vision from the trail of your posts. As of C++ concepts, let me mention a few facts fresh from the source (I literally collected them an hour ago). C++ concepts are dead, buried, and decomposing. Nobody is working on them and there is exactly one guy in the world still talking about them. For a variety of theoretical and practical purposes, they will never make it in C++. D's constrained templates were introduced on 17 June 2008 and they've been a smashing hit. Virtually all of Phobos uses them, and I'm sure a lot of generic client code. They take half a minute to explain and solve a difficult problem in a very simple manner. I'm not saying you can't convince that C++-style concepts would be superior. I'm saying you'll need to bring some solid evidence to the table. If you don't, please don't claim you're being ostracized :o). Andrei
Dec 13 2010
next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Andrei:

D's constrained templates were introduced on 17 June 2008 and they've been a
smashing hit. Virtually all of Phobos uses them, and I'm sure a lot of generic
client code. They take half a minute to explain and solve a difficult problem
in a very simple manner.<
A template with two constrains makes it less handy to add error messages that explain why the instantiation has failed: template Foo(T) if (Pred1!T && Pred2!T) { ... } An alternative syntax (same semantics) similar to a (static) precondition Contract gives more space for error messages: template Foo(T) static in { static assert(Pred1!T, "err msg 1"); static assert(Pred2!T, "err msg 2"); } body { ... } Function templates too may have the optional static precondition, before the optional (run time) precondition. Bye, bearophile
Dec 14 2010
parent reply Walter Bright <newshound2 digitalmars.com> writes:
bearophile wrote:
 Andrei:
 
 D's constrained templates were introduced on 17 June 2008 and they've been
 a smashing hit. Virtually all of Phobos uses them, and I'm sure a lot of
 generic client code. They take half a minute to explain and solve a
 difficult problem in a very simple manner.<
A template with two constrains makes it less handy to add error messages that explain why the instantiation has failed:
Adding such error messages misses the point of constraints. The idea is that template overloading is based on constraints. Given 3 templates with 3 constraints, overload resolution picks the one with constraints that pass. Giving error messages for the others is wrong. If you want it to produce error messages if the instantiation is wrong, the correct way is to use static asserts within the template body. No additional features serve any purpose.
Dec 14 2010
next sibling parent bearophile <bearophileHUGS lycos.com> writes:
Walter:

 Adding such error messages misses the point of constraints. The idea is that 
 template overloading is based on constraints. Given 3 templates with 3 
 constraints, overload resolution picks the one with constraints that pass. 
 Giving error messages for the others is wrong.
You are right, I miss things all the time :-) Thank you for your patience.
 If you want it to produce error messages if the instantiation is wrong, the 
 correct way is to use static asserts within the template body. No additional 
 features serve any purpose.
If the purpose is to produce error messages if the instantiation is wrong, then using a "static precondition" instead of normal free static asserts may give a bit better error messages (errors at the instantiation point instead of inside the template). But I guess this is just a limit of the compiler, not a problem of the language... Bye, bearophile
Dec 14 2010
prev sibling next sibling parent reply Don <nospam nospam.com> writes:
Walter Bright wrote:
 bearophile wrote:
 Andrei:

 D's constrained templates were introduced on 17 June 2008 and they've 
 been
 a smashing hit. Virtually all of Phobos uses them, and I'm sure a lot of
 generic client code. They take half a minute to explain and solve a
 difficult problem in a very simple manner.<
A template with two constrains makes it less handy to add error messages that explain why the instantiation has failed:
Adding such error messages misses the point of constraints. The idea is that template overloading is based on constraints. Given 3 templates with 3 constraints, overload resolution picks the one with constraints that pass. Giving error messages for the others is wrong. If you want it to produce error messages if the instantiation is wrong, the correct way is to use static asserts within the template body. No additional features serve any purpose.
Actually I think there's considerable potential for better error messages. Currently, if constraints fail for all templates, the error message prints the full constraint for the first template, which is not very helpful. A huge improvement would be to distinguish "no templates match at all", (eg the number of parameters is different) from "there are templates which would match, except that the template constraints fail".
Dec 14 2010
next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Tuesday 14 December 2010 00:45:02 Don wrote:
 Walter Bright wrote:
 bearophile wrote:
 Andrei:
 D's constrained templates were introduced on 17 June 2008 and they've
 been
 a smashing hit. Virtually all of Phobos uses them, and I'm sure a lot
 of generic client code. They take half a minute to explain and solve a
 difficult problem in a very simple manner.<
A template with two constrains makes it less handy to add error messages that
 explain why the instantiation has failed:
Adding such error messages misses the point of constraints. The idea is that template overloading is based on constraints. Given 3 templates with 3 constraints, overload resolution picks the one with constraints that pass. Giving error messages for the others is wrong. If you want it to produce error messages if the instantiation is wrong, the correct way is to use static asserts within the template body. No additional features serve any purpose.
Actually I think there's considerable potential for better error messages. Currently, if constraints fail for all templates, the error message prints the full constraint for the first template, which is not very helpful. A huge improvement would be to distinguish "no templates match at all", (eg the number of parameters is different) from "there are templates which would match, except that the template constraints fail".
Simply indicating that some of the templates' signatures match (or that none do) but that their constraints fail would be useful. Right now, you don't even know whether its the signature that doesn't match or whether it's the constraint that fails. - Jonathan M Davis
Dec 14 2010
prev sibling parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/14/10 2:45 AM, Don wrote:
 Walter Bright wrote:
 bearophile wrote:
 Andrei:

 D's constrained templates were introduced on 17 June 2008 and
 they've been
 a smashing hit. Virtually all of Phobos uses them, and I'm sure a
 lot of
 generic client code. They take half a minute to explain and solve a
 difficult problem in a very simple manner.<
A template with two constrains makes it less handy to add error messages that explain why the instantiation has failed:
Adding such error messages misses the point of constraints. The idea is that template overloading is based on constraints. Given 3 templates with 3 constraints, overload resolution picks the one with constraints that pass. Giving error messages for the others is wrong. If you want it to produce error messages if the instantiation is wrong, the correct way is to use static asserts within the template body. No additional features serve any purpose.
Actually I think there's considerable potential for better error messages. Currently, if constraints fail for all templates, the error message prints the full constraint for the first template, which is not very helpful. A huge improvement would be to distinguish "no templates match at all", (eg the number of parameters is different) from "there are templates which would match, except that the template constraints fail".
Yes, printing the first constraint is quite random. This should be listed as a bug. Andrei
Dec 14 2010
prev sibling next sibling parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Tuesday 14 December 2010 00:23:58 Walter Bright wrote:
 bearophile wrote:
 Andrei:
 D's constrained templates were introduced on 17 June 2008 and they've
 been a smashing hit. Virtually all of Phobos uses them, and I'm sure a
 lot of generic client code. They take half a minute to explain and
 solve a difficult problem in a very simple manner.<
A template with two constrains makes it less handy to add error messages that
 explain why the instantiation has failed:
Adding such error messages misses the point of constraints. The idea is that template overloading is based on constraints. Given 3 templates with 3 constraints, overload resolution picks the one with constraints that pass. Giving error messages for the others is wrong. If you want it to produce error messages if the instantiation is wrong, the correct way is to use static asserts within the template body. No additional features serve any purpose.
It could definitely serve a purpose if _all_ of the possible template specializations fail. Presumably, you intend _one_ of them to work. But that _does_ mean that you get error messages for a number of different template specializations, and you have to sort through them. It _can_ take a fair bit of effort to figure out why a particular template constraint is failing, and it would definitely be nice if there were more information on _why_ a template constraint fails. However, I do agree that doing so could get rather complicated, and that ultimately, it probably isn't worth it. I fully expect, however, that many people in the future will complain that they can't get better error messages which indicate why a particular template constraint failed. - Jonathan M Davis
Dec 14 2010
prev sibling next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/14/10 2:23 AM, Walter Bright wrote:
 bearophile wrote:
 Andrei:

 D's constrained templates were introduced on 17 June 2008 and they've
 been
 a smashing hit. Virtually all of Phobos uses them, and I'm sure a lot of
 generic client code. They take half a minute to explain and solve a
 difficult problem in a very simple manner.<
A template with two constrains makes it less handy to add error messages that explain why the instantiation has failed:
Adding such error messages misses the point of constraints. The idea is that template overloading is based on constraints. Given 3 templates with 3 constraints, overload resolution picks the one with constraints that pass. Giving error messages for the others is wrong. If you want it to produce error messages if the instantiation is wrong, the correct way is to use static asserts within the template body. No additional features serve any purpose.
Yah, I was planning on writing the same response. Andrei
Dec 14 2010
parent reply biozic <dransic free.fr> writes:
Le 14/12/10 09:56, Andrei Alexandrescu a écrit :
 On 12/14/10 2:23 AM, Walter Bright wrote:
 bearophile wrote:
 Andrei:

 D's constrained templates were introduced on 17 June 2008 and they've
 been
 a smashing hit. Virtually all of Phobos uses them, and I'm sure a 
 lot of
 generic client code. They take half a minute to explain and solve a
 difficult problem in a very simple manner.<
A template with two constrains makes it less handy to add error messages that explain why the instantiation has failed:
Adding such error messages misses the point of constraints. The idea is that template overloading is based on constraints. Given 3 templates with 3 constraints, overload resolution picks the one with constraints that pass. Giving error messages for the others is wrong. If you want it to produce error messages if the instantiation is wrong, the correct way is to use static asserts within the template body. No additional features serve any purpose.
Yah, I was planning on writing the same response. Andrei
I have a question about this and some pieces of code in the standard library, notably std.algorithm: some of the templated functions use template constraints even when no template overloading is taking place. Wouldn't some static asserts help print more accurate messages when these functions are misused? Nicolas
Dec 14 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/14/10 7:33 AM, biozic wrote:
 Le 14/12/10 09:56, Andrei Alexandrescu a écrit :
 On 12/14/10 2:23 AM, Walter Bright wrote:
 bearophile wrote:
 Andrei:

 D's constrained templates were introduced on 17 June 2008 and they've
 been
 a smashing hit. Virtually all of Phobos uses them, and I'm sure a
 lot of
 generic client code. They take half a minute to explain and solve a
 difficult problem in a very simple manner.<
A template with two constrains makes it less handy to add error messages that explain why the instantiation has failed:
Adding such error messages misses the point of constraints. The idea is that template overloading is based on constraints. Given 3 templates with 3 constraints, overload resolution picks the one with constraints that pass. Giving error messages for the others is wrong. If you want it to produce error messages if the instantiation is wrong, the correct way is to use static asserts within the template body. No additional features serve any purpose.
Yah, I was planning on writing the same response. Andrei
I have a question about this and some pieces of code in the standard library, notably std.algorithm: some of the templated functions use template constraints even when no template overloading is taking place. Wouldn't some static asserts help print more accurate messages when these functions are misused? Nicolas
The intent is to allow other code to define functions such as e.g. "map" or "sort". Generally any generic function should exclude via a constraint the inputs it can't work on. That way no generic function bites off more than it can chew. Andrei
Dec 14 2010
parent biozic <dransic free.fr> writes:
Le 14/12/10 16:50, Andrei Alexandrescu a écrit :
 On 12/14/10 7:33 AM, biozic wrote:
 Le 14/12/10 09:56, Andrei Alexandrescu a écrit :
 On 12/14/10 2:23 AM, Walter Bright wrote:
 bearophile wrote:
 Andrei:

 D's constrained templates were introduced on 17 June 2008 and 
 they've
 been
 a smashing hit. Virtually all of Phobos uses them, and I'm sure a
 lot of
 generic client code. They take half a minute to explain and solve a
 difficult problem in a very simple manner.<
A template with two constrains makes it less handy to add error messages that explain why the instantiation has failed:
Adding such error messages misses the point of constraints. The idea is that template overloading is based on constraints. Given 3 templates with 3 constraints, overload resolution picks the one with constraints that pass. Giving error messages for the others is wrong. If you want it to produce error messages if the instantiation is wrong, the correct way is to use static asserts within the template body. No additional features serve any purpose.
Yah, I was planning on writing the same response. Andrei
I have a question about this and some pieces of code in the standard library, notably std.algorithm: some of the templated functions use template constraints even when no template overloading is taking place. Wouldn't some static asserts help print more accurate messages when these functions are misused? Nicolas
The intent is to allow other code to define functions such as e.g. "map" or "sort". Generally any generic function should exclude via a constraint the inputs it can't work on. That way no generic function bites off more than it can chew. Andrei
Yes, I understand that this is more important than the accuracy of error messages. Thanks
Dec 14 2010
prev sibling parent spir <denis.spir gmail.com> writes:
On Tue, 14 Dec 2010 00:49:10 -0800
Jonathan M Davis <jmdavisProg gmx.com> wrote:

 It could definitely serve a purpose if _all_ of the possible template=20
 specializations fail. Presumably, you intend _one_ of them to work. But t=
hat=20
 _does_ mean that you get error messages for a number of different templat=
e=20
 specializations, and you have to sort through them. It _can_ take a fair =
bit of=20
 effort to figure out why a particular template constraint is failing, and=
it would=20
 definitely be nice if there were more information on _why_ a template con=
straint=20
 fails.
The case is analog to producing a sensible parsing error message in case of= a choice: P : P1 | P2 | P3 The only solutions are to ignore the issue or to provide error messages for= every Pi. This gives for instance: unittest{ auto a =3D character('a'); auto b =3D character('b'); auto c =3D character('c'); auto ch =3D choice(a, b, c)("ch"); ch.match("d"); } =3D=3D> ****************************************************************** Match Failure: cannot match expected pattern. pattern : ch=3D('a'|'b'|'c') index : 0 found : d Failure reasons for sub-patterns:=20 ****************************************************************** ****************************************************************** Match Failure: cannot match expected pattern. pattern : 'a' index : 0 found : d ****************************************************************** ****************************************************************** Match Failure: cannot match expected pattern. pattern : 'b' index : 0 found : d ****************************************************************** ****************************************************************** Match Failure: cannot match expected pattern. pattern : 'c' index : 0 found : d ****************************************************************** (Actually, the parsing lib does not yet indent sub-pattern error messages -= - I cheated.) I guess a similar scheme can be used for template error messages (when _all= _ versions fail). Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Dec 14 2010
prev sibling parent spir <denis.spir gmail.com> writes:
On Tue, 14 Dec 2010 01:43:11 -0600
Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:

 I'm also a bit more of a
 fan of C++0x concepts than those contraints shown in the slides. I
 haven't really thought how it all would work out, but if the atmosphere
 was more ambitious to this direction, I could participate more. But it
 seems my vision conflicts badly with what D2 has become. =20
=20 In all honesty, it is difficult to infer your vision from the trail of=20 your posts. =20 As of C++ concepts, let me mention a few facts fresh from the source (I=20 literally collected them an hour ago). C++ concepts are dead, buried,=20 and decomposing. Nobody is working on them and there is exactly one guy=20 in the world still talking about them. For a variety of theoretical and=20 practical purposes, they will never make it in C++. =20 D's constrained templates were introduced on 17 June 2008 and they've=20 been a smashing hit. Virtually all of Phobos uses them, and I'm sure a=20 lot of generic client code. They take half a minute to explain and solve=
=20
 a difficult problem in a very simple manner.
=20
 I'm not saying you can't convince that C++-style concepts would be=20
 superior. I'm saying you'll need to bring some solid evidence to the=20
 table. If you don't, please don't claim you're being ostracized :o).
About "concept" + "programming", you may have a look at XL http://xlr.sourc= eforge.net/concept/toplevel.html (an extensible PL, or a set of PLs, built = to support "concept programming") (more info at http://xlr.sourceforge.net/= concept/top.html). This language also has a very clear (semantics) & nice (= syntax) template/generics system... with constraints (done right, imo). (Ex= ample at http://xlr.sourceforge.net/examples/maximum.html) Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Dec 14 2010
prev sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
Looks like someone did:
http://www.reddit.com/r/programming/comments/eklq0/andrei_alexandrescus_talk_at_accu_silicon_valley/

On 12/12/10, Walter Bright <newshound2 digitalmars.com> wrote:
 Andrei Alexandrescu wrote:
 Compared to the talk at Google, I changed one of the "cool things" from
 threading to operator overloading. Didn't manage to talk about that -
 there were a million questions - although I think it's a great topic.

 http://erdani.com/tdpl/2010-12-08-ACCU.pdf
Anyone care to do the honors and post this to reddit programming?
Dec 12 2010
prev sibling next sibling parent reply Hemanth Kapila <saihemanth gmail.com> writes:
Hi,

Thanks for sharing the doc.

 I changed one of the "cool things" from threading to operator overloading.
May I know the reason behind the change? Is it that you intend to pick different "3 cool things" at different talks? or do you think operator overloading is 'cooler' than concurrency? Thanks, Hemanth
Dec 12 2010
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/12/10 9:50 PM, Hemanth Kapila wrote:
 Hi,

 Thanks for sharing the doc.

     I changed one of the "cool things" from threading to operator
     overloading.

 May I know the reason behind the change? Is it that you intend to pick
 different "3 cool things" at different talks? or do you think operator
 overloading is 'cooler'  than concurrency?

 Thanks,
 Hemanth
I thought since the video of my Google talk is already online, I better offer something new. I would have changed two of the three topics, but didn't have time. It's ironic I couldn't find time to talk about overloading. Andrei
Dec 12 2010
prev sibling next sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Jonathan M Davis:

 I don't see what that poster thought would be gained by enforcing that,
If you read that part in the Reddit thread you see that the gain is in a (supposed) higher understandability of the code that uses the operators.
 but it's _really_ easy to have useful and legitimate overloaded operators
which can't be pure.
Do you have examples? Bye, bearophile
Dec 13 2010
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Monday 13 December 2010 04:05:33 bearophile wrote:
 Jonathan M Davis:
 I don't see what that poster thought would be gained by enforcing that,
If you read that part in the Reddit thread you see that the gain is in a (supposed) higher understandability of the code that uses the operators.
 but it's _really_ easy to have useful and legitimate overloaded operators
 which can't be pure.
Do you have examples?
At the momement, pretty much none of the operator overloads in std.datetime are pure, and while some of them _may_ be able to become pure with the pure nothrow bug fixed, I don't think that they'll all be able to. All it takes is _one_ function in the whole call chain which can't be pure, and then _none_ of them can pure. It's _really_ easy to make purity not possible. Things will improve as more of Phobos becomes pure, but forcing stuff to be pure is generally a _bad_ idea. - Jonathan M Davis
Dec 13 2010
prev sibling parent reply bearophile <bearophileHUGS lycos.com> writes:
Andrei:
 http://erdani.com/tdpl/2010-12-08-ACCU.pdf
I have a small question. At page 34 of the slides it says:
 - Built-in complex types are being replaced by library types
Are complex types totally replaced, or is the complex literals syntax (like 10+10i) kept? Keeping those literals may be good. Bye, bearophile
Dec 13 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/13/10 6:11 AM, bearophile wrote:
 Andrei:
 http://erdani.com/tdpl/2010-12-08-ACCU.pdf
I have a small question. At page 34 of the slides it says:
 - Built-in complex types are being replaced by library types
Are complex types totally replaced, or is the complex literals syntax (like 10+10i) kept? Keeping those literals may be good.
Walter wants to keep complex literals. I strongly believe they are completely useless. Andrei
Dec 13 2010
next sibling parent bearophile <bearophileHUGS lycos.com> writes:
Andrei:

Walter wants to keep complex literals. I strongly believe they are completely
useless.<
Thank you for your answer. So far I have used D complex numbers only two times, so I don't have to use them often, so I don't feel a strong need for them. But I like that people that use them often will find a handy syntax for those literals. Generally I like good literals, it's one of the differences between D and dumb languages. For example I'd like DMD to support multi-precision integer literals too: bigint x = 100_000_000_000_000_000_000_000_000_000_000_000_000; We may write down a list of all the advantages and disadvantages of complex literals (and I'd like someone that writes code that processes complex values to help in the writing of this list), and then try to decide rationally to keep them or remove them. I don't have strong feelings about this topic, so I will have no problems with both results. Bye, bearophile
Dec 13 2010
prev sibling parent reply "Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> writes:
On Mon, 13 Dec 2010 09:29:15 -0600, Andrei Alexandrescu wrote:

 On 12/13/10 6:11 AM, bearophile wrote:
 Andrei:
 http://erdani.com/tdpl/2010-12-08-ACCU.pdf
I have a small question. At page 34 of the slides it says:
 - Built-in complex types are being replaced by library types
Are complex types totally replaced, or is the complex literals syntax (like 10+10i) kept? Keeping those literals may be good.
Walter wants to keep complex literals. I strongly believe they are completely useless.
I agree with this. It would be interesting to know how often people actually write complex literals. I suspect it is *very* rare. And how would it work, anyway? Should we be required to import std.complex to use complex literals? In my opinion, when the built-in complex types are deprecated, the literals should go as well. -Lars
Dec 14 2010
next sibling parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/14/10 2:56 AM, Lars T. Kyllingstad wrote:
 On Mon, 13 Dec 2010 09:29:15 -0600, Andrei Alexandrescu wrote:

 On 12/13/10 6:11 AM, bearophile wrote:
 Andrei:
 http://erdani.com/tdpl/2010-12-08-ACCU.pdf
I have a small question. At page 34 of the slides it says:
 - Built-in complex types are being replaced by library types
Are complex types totally replaced, or is the complex literals syntax (like 10+10i) kept? Keeping those literals may be good.
Walter wants to keep complex literals. I strongly believe they are completely useless.
I agree with this. It would be interesting to know how often people actually write complex literals. I suspect it is *very* rare. And how would it work, anyway? Should we be required to import std.complex to use complex literals? In my opinion, when the built-in complex types are deprecated, the literals should go as well.
I asked people at a seminar during a recess: "How many remarkable complex constants do you know?" After a long pause, one person replied: "1 + 0i". That brought down the house. Andrei
Dec 14 2010
parent reply bearophile <bearophileHUGS lycos.com> writes:
Andrei:

 I asked people at a seminar during a recess: "How many remarkable 
 complex constants do you know?" After a long pause, one person replied: 
 "1 + 0i".
Instead of asking that question, I suggest to ask people that write code that uses complex numbers if they like the idea of complex literals. And I suggest to analyse some Fortran/C code that uses complex numbers and count how often literals may be useful in the code, and how much they may improve the readability of the code. Bye, bearophile
Dec 14 2010
parent reply Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
On 12/14/10 3:24 AM, bearophile wrote:
 Andrei:

 I asked people at a seminar during a recess: "How many remarkable
 complex constants do you know?" After a long pause, one person
 replied: "1 + 0i".
Instead of asking that question, I suggest to ask people that write code that uses complex numbers if they like the idea of complex literals.
So you mean I should ask _that_ question but _other_ people.
 And I suggest to analyse some Fortran/C code that uses
 complex numbers and count how often literals may be useful in the
 code, and how much they may improve the readability of the code.
Magic constants have issues - be they strings, integrals, or doubles. I have trouble thinking that complex literals are somehow exempt. Andrei
Dec 14 2010
parent reply bearophile <bearophileHUGS lycos.com> writes:
Andrei:

 So you mean I should ask _that_ question but _other_ people.
I don't understand what you mean. There right questions need to be asked to the right people. I think most C/C++/D/Java programmers don't use complex numbers, so asking to generic programmers about complex numbers in their code may be useful just to know how often complex numbers are used in programs, but it can't tell you much about how good complex literal are. If you want to design complex numbers in D, you have to ask to people that surely have written more than 100 lines of code that uses complex numbers (in Python too there are complex literals, so some Python programmer too may be useful for such questions).
 Magic constants have issues - be they strings, integrals, or doubles. I 
 have trouble thinking that complex literals are somehow exempt.
I partially agree. They need to be used with care (and defined only once in the code). On the other hand removing all integral literals from my D programs isn't going to improve them :-) Bye, bearophile
Dec 14 2010
parent spir <denis.spir gmail.com> writes:
On Tue, 14 Dec 2010 05:15:05 -0500
bearophile <bearophileHUGS lycos.com> wrote:

 Magic constants have issues - be they strings, integrals, or doubles. I=
=20
 have trouble thinking that complex literals are somehow exempt. =20
=20 I partially agree. They need to be used with care (and defined only once =
in the code). On the other hand removing all integral literals from my D pr= ograms isn't going to improve them :-) What about (char &) string literals? Hello, World! in D: void main () { string message =3D [ 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x2c, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x21, ]; writeln(message); } And be happy that int's auto-cast to char's! Else, it would be: void main () { string message =3D [ cast(char)0x48, cast(char)0x65, cast(char)0x6c, cast(char)0x6c, cast(char)0x6f, cast(char)0x2c, cast(char)0x20, cast(char)0x57, cast(char)0x6f, cast(char)0x72, cast(char)0x6c, cast(char)0x64, cast(char)0x21, ]; writeln(message); } (works!) (Should we put this version on Wikipedia's Hello, World! page http://en.wik= ipedia.org/wiki/Hello_world_program_examples ?) Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Dec 14 2010
prev sibling next sibling parent reply Don <nospam nospam.com> writes:
Lars T. Kyllingstad wrote:
 On Mon, 13 Dec 2010 09:29:15 -0600, Andrei Alexandrescu wrote:
 
 On 12/13/10 6:11 AM, bearophile wrote:
 Andrei:
 http://erdani.com/tdpl/2010-12-08-ACCU.pdf
I have a small question. At page 34 of the slides it says:
 - Built-in complex types are being replaced by library types
Are complex types totally replaced, or is the complex literals syntax (like 10+10i) kept? Keeping those literals may be good.
Walter wants to keep complex literals. I strongly believe they are completely useless.
I agree with this. It would be interesting to know how often people actually write complex literals. I suspect it is *very* rare. And how would it work, anyway? Should we be required to import std.complex to use complex literals? In my opinion, when the built-in complex types are deprecated, the literals should go as well. -Lars
Agreed. I've just looked through some code that I thought used them extensively, but found only two complex literals: 1i (dozens of instances) and 2i (one instance).
Dec 14 2010
parent reply "Alex_Dovhal" <alex_dovhal yahoo.com> writes:
"Don" <nospam nospam.com> wrote:
 Agreed. I've just looked through some code that I thought used them 
 extensively, but found only two complex literals: 1i (dozens of instances) 
 and 2i (one instance).
So if D removes complex literals what the proposed name for Imaginary One would be? _i , i_ , _i_, _I , I , M_I ?? i j looks good to me, I'd like even having them both. Compare code: 0.998f + 2.72e-2fi 0.998f + i*2.72e-2f 0.998f + 2.72e-2f* j
Dec 14 2010
next sibling parent "Alex_Dovhal" <alex_dovhal yahoo.com> writes:
Oh sorry those  i and  j also would be build in. Ignore this. 
Dec 14 2010
prev sibling next sibling parent "Simen kjaeraas" <simen.kjaras gmail.com> writes:
Alex_Dovhal <alex_dovhal yahoo.com> wrote:

 "Don" <nospam nospam.com> wrote:
 Agreed. I've just looked through some code that I thought used them
 extensively, but found only two complex literals: 1i (dozens of  =
 instances)
 and 2i (one instance).
So if D removes complex literals what the proposed name for Imaginary=
=
 One
 would be?
 _i  ,   i_  ,   _i_,  _I  ,   I  ,   M_I   ??
  i    j   looks good to me, I'd like even having them both.

 Compare code:
 0.998f + 2.72e-2fi
 0.998f +  i*2.72e-2f
 0.998f + 2.72e-2f*  j
With D supporting Unicode, it should clearly be =E2=84=91. -- = Simen
Dec 14 2010
prev sibling parent reply Don <nospam nospam.com> writes:
Alex_Dovhal wrote:
 "Don" <nospam nospam.com> wrote:
 Agreed. I've just looked through some code that I thought used them 
 extensively, but found only two complex literals: 1i (dozens of instances) 
 and 2i (one instance).
So if D removes complex literals what the proposed name for Imaginary One would be? _i , i_ , _i_, _I , I , M_I ?? i j looks good to me, I'd like even having them both. Compare code: 0.998f + 2.72e-2fi 0.998f + i*2.72e-2f 0.998f + 2.72e-2f* j
Complex(9.998f, 2.72e-2f)
Dec 15 2010
parent reply "Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> writes:
On Wed, 15 Dec 2010 15:20:01 +0100, Don wrote:

 Alex_Dovhal wrote:
 "Don" <nospam nospam.com> wrote:
 Agreed. I've just looked through some code that I thought used them
 extensively, but found only two complex literals: 1i (dozens of
 instances) and 2i (one instance).
So if D removes complex literals what the proposed name for Imaginary One would be? _i , i_ , _i_, _I , I , M_I ?? i j looks good to me, I'd like even having them both. Compare code: 0.998f + 2.72e-2fi 0.998f + i*2.72e-2f 0.998f + 2.72e-2f* j
Complex(9.998f, 2.72e-2f)
And if someone *really* wants to put the "i" in there, they can just define it in their own app: enum i = Complex!double(0, 1); auto z = 0.998 + 2.72e-2*i; -Lars
Dec 15 2010
next sibling parent spir <denis.spir gmail.com> writes:
On Wed, 15 Dec 2010 14:34:47 +0000 (UTC)
"Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> wrote:

 And if someone *really* wants to put the "i" in there, they can just=20
 define it in their own app:
=20
   enum i =3D Complex!double(0, 1);
   auto z =3D 0.998 + 2.72e-2*i;
+++ Denis -- -- -- -- -- -- -- vit esse estrany =E2=98=A3 spir.wikidot.com
Dec 15 2010
prev sibling next sibling parent Ellery Newcomer <ellery-newcomer utulsa.edu> writes:
On 12/15/2010 08:34 AM, Lars T. Kyllingstad wrote:
 And if someone *really* wants to put the "i" in there, they can just
 define it in their own app:

    enum i = Complex!double(0, 1);
    auto z = 0.998 + 2.72e-2*i;

 -Lars
or Complex!"0.998 + 2.72e-2i"
Dec 15 2010
prev sibling parent "Alex_Dovhal" <alex_dovhal yahoo.com> writes:
"Lars T. Kyllingstad" <public kyllingen.NOSPAMnet> wrote:
 And if someone *really* wants to put the "i" in there, they can just
 define it in their own app:

  enum i = Complex!double(0, 1);
  auto z = 0.998 + 2.72e-2*i;

 -Lars
Looks very nice.
Dec 15 2010
prev sibling parent so <so so.do> writes:
On Tue, 14 Dec 2010 10:56:18 +0200, Lars T. Kyllingstad  
<public kyllingen.nospamnet> wrote:

 On Mon, 13 Dec 2010 09:29:15 -0600, Andrei Alexandrescu wrote:

 On 12/13/10 6:11 AM, bearophile wrote:
 Andrei:
 http://erdani.com/tdpl/2010-12-08-ACCU.pdf
I have a small question. At page 34 of the slides it says:
 - Built-in complex types are being replaced by library types
Are complex types totally replaced, or is the complex literals syntax (like 10+10i) kept? Keeping those literals may be good.
Walter wants to keep complex literals. I strongly believe they are completely useless.
I agree with this. It would be interesting to know how often people actually write complex literals. I suspect it is *very* rare. And how would it work, anyway? Should we be required to import std.complex to use complex literals? In my opinion, when the built-in complex types are deprecated, the literals should go as well. -Lars
My first and only proposal to this newsgroup was about literals. C like literals already come with a few serious issues if you use them in a template heavy code. For example a C++ template (which meant to be a generic solution) full of "casts" yes casts!, and this is not an unusual practice The replies i got made me think that D solves some of these. For the topic. Having complex literals cool, but i can live without them! -- Using Opera's revolutionary email client: http://www.opera.com/mail/
Dec 14 2010