Does D have too many features?

Alex Rønne Petersen xtzgzorex at gmail.com
Sun Apr 29 15:27:54 PDT 2012


On 30-04-2012 00:08, Timon Gehr wrote:
> On 04/29/2012 10:59 PM, Alex Rønne Petersen wrote:
>> On 29-04-2012 14:26, David Nadlinger wrote:
>>> - Unsigned right shift, but I can see how it can be useful (simply
>>> underused?).
>>
>> It's clear that arithmetic right shift is what the programmer usually
>> wants, and yet, we use >> to denote what they don't want. It's
>> completely counter-intuitive.
>>
>> So, +1.
>>
>
> '>>' is arithmetic right shift.

Sorry, I managed to get myself confused here. What I meant to say was 
that I think >> should do an arithmetic shift if the operands are 
signed; unsigned shift otherwise.

>
>>>
>>> - shared: TLS by default is great, but only __gshared is really usable
>>> right now. IMHO, shared had better been reserved for a comprehensive
>>> take on the subject, rather than the half-baked implementation we have
>>> right now.
>>>
>>> David
>>
>> It's clear that shared is biased towards heavily templatized code.
>> It's not useful in non-templatized code because such code can't accept
>> both
>> shared and non-shared values.
>
> Just cast it away if you do eg. locking. There is nothing wrong with it.
> Code that operates on both (actually) shared and unshared data should be
> uncommon anyway.

The problem is that shared is supposed to insert memory barriers (I know 
it doesn't, but that's the goal/idea).

>
>>
>> shared looks neat in theory, but is a fallacy in practice.
>>
>
> unshared is what is important. There is no unshared if there is no shared.

I think this statement went over my head...

-- 
- Alex


More information about the Digitalmars-d mailing list