Operator overloading or alternatives to expression templates

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Thu Sep 17 12:23:43 PDT 2015


On 09/15/2015 06:53 PM, Andrei Alexandrescu wrote:
> On 09/14/2015 03:35 PM, Timon Gehr wrote:
>> On 09/14/2015 08:09 PM, Andrei Alexandrescu wrote:
>>> On 09/13/2015 10:06 AM, Martin Nowak wrote:
>>>> ...
>>>> - language regularization
>>>>
>>>>    It's surprising to find these "arbitrary" language limitations.
>>>>    The non-predictability of what's possible has always been a huge
>>>> issue
>>>> for me with C++, i.e. you come up with an idea, spend 4 hours
>>>> implementing it only to find out that the small detail x isn't
>>>> feasible.
>>>
>>> This is the case in all powerful languages.
>>
>> That's an overgeneralization.
>
> Aren't they all :o).
> ...

I guess we have now established that there are at least two of them. :P

>> Furthermore, having arbitrary designed-in irregularities is not
>> comparable to implementing a system whose emergent behavior is not
>> understood sufficiently well. (D is guilty of both, but the former is
>> much easier to fix than the latter.)
>>
>>> Martin Odersky told me there's a constant problem with Scala ...
>>
>> Both C++ and Scala have accidentally Turing-complete type systems.
>
> I think what I'm trying to say is "I'm trying to do this very advanced
> thing and the language support is insufficient" is the kind of argument
> that needs to be made and taken with caution.
> ...

This is certainly the case, and I believe the necessary care has been 
applied. The language support required isn't actually very advanced, nor 
are all usage scenarios. Arbitrary restrictions are usually design mistakes.


More information about the Digitalmars-d mailing list