December 14, 2010
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

December 14, 2010
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

December 14, 2010
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.
> > >>
> > 
> 

December 14, 2010
"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.


December 14, 2010
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.
December 15, 2010
"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.


1 2 3 4
Next ›   Last »