http://wiki.dlang.org/DIP25

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 2 13:16:14 PST 2015


On 12/31/2014 3:23 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= <schuetzm at gmx.net>" wrote:
> So... how does this apply to our problem concretely? Do you believe a full blown
> ownership/lifetime system is "the wrong kind of power"? Remember, we're talking
> about an ideal world at first. If after thorough discussion it turns out that it
> can't be integrated into D, at least we know that it's probably not possible.
> But I haven't seen any indications that this is the case; in fact, it's not even
> been discussed.

I don't believe it is impossible to implement in D, in fact, Bartosz Milewski 
proposed such a system some years back. I do believe that people will simply 
reject such a system as too hard to use.

(The reason dynamically typed languages are enduringly popular is that it is 
easier to write code in them. People are inherently lazy. A full blown 
lifetime/ownership system laid over a static type system would be an increase in 
programmer effort comparable to the gap between a dynamic and static type 
system. I don't believe programmers will go for it.)


>> Also, programmers do not really want a complex annotation system. They want to
>> just write code in the most obvious manner and have it work correctly. Having
>> a powerful (but complex) system is not very attractive.
>
> But a powerful system doesn't need to be complicated. In fact, a system with a
> handful of general and orthogonal features is likely easier to understand and
> handle in practice than one with lots of (even trivial) edge cases and exceptions.

I agree that we all want that, but designing one that delivers such is another 
matter entirely.

Programmers discover repeatedly that what is general, simple, and orthogonal for 
computers is grossly unintuitive and non-obvious for people. Successful user 
interfaces are a mass of code implementing a mass of special cases.

Computer languages are user interfaces.

For a topical example, check out the threads here on the Ddoc syntax. Many have 
strongly argued against the simple, general, powerful and orthogonal macro 
syntax in favor of an idiosyncratic mass of special cases. It's classic.


More information about the Digitalmars-d mailing list