disabling unary "-" for unsigned types

retard re at tard.com.invalid
Sun Feb 14 18:47:05 PST 2010


Sun, 14 Feb 2010 18:12:25 -0500, bearophile wrote:

> Walter Bright:
>> D is a very ambitious language, and we are definitely shooting for the
>> stars with it. That means that there are many features that missed or
>> otherwise failed to find a target. So we're doing a little pruning for
>> D2, and a big part of posting these possible prunes here is to make
>> sure we aren't missing an important use case for them.
> 
> D2 is a mix of some different kind of features: - C features. Some of
> them are not perfect, but we know their ups and downs, their risks and
> their qualities. - Some features are patches/fixes over C features that
> are known to be dangerous, not handy, bug prone, etc. Walter has enough
> experience with C that they are probably all good things. - Some new
> features that come from years of D1 development/usage or from other
> languages. They are not perfect (for example you can by mistake put the
> underscore in a wrong place in a number literal, and this can produce a
> deceiving number. Ideally in base 10 underscores can be syntactically
> allowed only every 3 digits and in base 2 or 6 every 4,8,16,32,16 digits
> only), but they are generally known enough to be safe enough bets. - And
> finally in D2 there are several new features that are sometimes only
> half-implemented, and generally no one has tried them in long programs,
> they seem to come from just the mind of few (intelligent) people, they
> don't seem battle-tested at all. Such new features are a dangerous bet,
> they can hide many traps and problems. Finalizing the D2 language before
> people have actually tried to use such features in some larger programs
> looks dangerous. Recently I have understood that this is why Simon
> Peyton-Jones said "Avoid success at all costs" regarding Haskell, that
> he has slowly developed for about 15 years: to give the language the
> time to be tuned, to remove warts, to improve it before people start to
> use it for rear and it needs to be frozen (today we are probably in a
> phase when Haskell has to be frozen, because there is enough software
> written in it that you can't lightly break backward compatibility).
> 
> So I am a little worried for some of the last features introduced in D2.
> I don't know if D3 can solve this problem (maybe not).

The problem I see with D is that Walter has mostly experience with C/C++. 
The features inherited from those languages tend to work much better in D.

OTOH Walter has very little experience with languages that have powerful 
meta-programming facilities (especially reflection), modular module 
systems with proper abstraction capabilities, lambdas, algebraic 
datatypes, immutability, testing/verification capabilities (asserts, unit 
tests etc.), special type systems such as linear or uniqueness types, and 
state of the art OOP features (Scala). That's why many of these features 
sucked / still suck.

There's no good rationale behind some decisions such as protection 
attributes in inheritance or anonymous classes. That's also the reason 
why 'strings ~/dmd/linux/dmd' returns several references to things called 
'tuples', but those don't behave at all like the product types in some 
other languages. Basically D just shows how well Walter has read his CS 
books. It's not a perfect language even though Walter is a compiler 
expert. Every time he learns a new feature, D usually gets a half-broken 
implementation of it. This happens regularly. Some call this featuritis. 
This is not the case in languages designed by language experts such as 
Guy Steele, Simon Peyton Jones, or John McCarthy.



More information about the Digitalmars-d mailing list