Rant after trying Rust a bit
via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jul 27 01:20:15 PDT 2015
On Monday, 27 July 2015 at 07:21:36 UTC, Tobias Müller wrote:
> Walter Bright <newshound2 at digitalmars.com> wrote:
>> On 7/26/2015 3:44 PM, deadalnix wrote:
>>> or template code (which will blow up at instanciation time,
>>> or worse, do random
>>> shit).
>>
>> Um, all Rust traits do is test for a method signature match,
>> so it compiles. It is NOT a defense against a random method
>> that just happens to match and does some other unrelated
>> random shit.
>
> Rust traits have to be implemented *explicitly*. It's not just
> an implicit test for a matching signature.
Explicit is good, but D's problem is that it already have
numerous language concepts covering the same type of semantics:
classes, interfaces, alias this, template duck-typing, template
constraints…
C++ only have classes and template SFINAE duck-typing. Everything
else is just idioms or library constructs.
Adding yet another langauge level interface mechanism to D would
IMO require language redesign. Which is not a bad idea, but not
likely in the near term?
More information about the Digitalmars-d
mailing list