On 21 May 2016 at 23:20, Andrei Alexandrescu via
Digitalmars-d-announce <digitalmars-d-announce@puremagic.com> wrote:
> On 05/21/2016 04:45 AM, Manu via Digitalmars-d-announce wrote:
>> On 20 May 2016 at 18:26, Walter Bright via Digitalmars-d-announce
>> <digitalmars-d-announce@puremagic.com> wrote:
>>> On 5/19/2016 11:50 PM, Manu via Digitalmars-d-announce wrote:
>>>> Ah. Okay, well while this is a very interesting talk, I was indeed
>>>> hoping you were going to make a D concepts proposal... do you have
>>>> such a thing in mind, or are you against concepts in D?
>>> D has constraints. No point in adding concepts.
>> I really struggle to agree. Constraints are a good first-step in that
>> direction, but they're unwieldy, produce the worst looking function
>> signatures (read: documentation) of literally any language ever
>> conceived, relatively awkward error feedback, and very quickly get out
>> of hand if you have many variations of possible constraints.
> I guess a lot more detail would be necessary here. A bunch of good folks (at
> least better than me) have worked for over a decade on C++ concepts and
> three (three!) proposals later it's still unclear whether they're a good
> idea. -- Andrei

I agree it's not clear to me either. I haven't seen any proposals for
D. Have there been any?
Constraints obviously work, but I do constantly find myself wishing
there were something a little bit closer to the type system.
I generally like where C++ is going. I think part of the problem with
C++, as always, is that they are in a constant struggle to bolt things
on to an ancient language with so many existing spiky angular edge
cases that it always seems to become awkward.

I think my biggest gripe with constraints in D though, is that they
are quite pervasive when you start to produce generic API's, and the
documentation becomes a massive problem.
Every single person (seriously) I've ever introduced to D has
struggled with the phobos docs as soon as constraints are presented.
Many of us have raised this many times, and we've had a lot of
discussion and various experiments with improving the documentation
wrt existing constraints. I'm not sure we've doing a good
documentation solution her, and I'm not even confident there's a good
solution there. I just don't think it's a great way to express the
problem. Concepts, or something like it, feels a lot more intuitive to
me, and certainly lends much nicer to documentation and API

Reply via email to