Rant after trying Rust a bit

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 23 19:02:12 PDT 2015


On 7/23/2015 6:05 PM, H. S. Teoh via Digitalmars-d wrote:
> It doesn't solve *all* the problems, but it does solve a
> significant subset of them.

The worst case of not having this feature is a compile time error. Not a runtime 
error, undetectable error, or silent corruption. A compile time error.

I also believe that you underestimate the nuisance significance of requiring the 
constraints cover 100% of everything the template body does.

Experience with something similar is with exception specifications. Even 
advocates of ES found themselves writing obviously crap code to work around the 
issue, because ES was so damned annoying.

I know a lot of the programming community is sold on exclusive constraints (C++ 
concepts, Rust traits) rather than inclusive ones (D constraints). What I don't 
see is a lot of experience actually using them long term. They may not turn out 
so well, like ES.


More information about the Digitalmars-d mailing list