If I had my way

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Dec 11 12:08:15 PST 2011


On 12/11/11 1:05 PM, Jesse Phillips wrote:
> I wish to add a little of why Mehrdad's complaints are very important. I
> think the delay is a good, over releasing 2.058 two days later.
>
> Most in the community have chosen what they will use of D, they know of
> some issues (no multiple alias this), or don't know how best to use
> something (concurrency).
>
> In our marketing for the language we express how great such-and-such is,
> but know that problems will be found by those that use it. We could not
> mention concurrency and how immutable/const plays its rule, but we need
> to answer what is different from D1 and how the future of computing will
> be easier in D.

Agreed.

> Interestingly Mehrdad has chosen something which does basically nothing,
> the const system. Const isn't important at _all_, except that it is a
> pillar for our functional concurrent purity. We claim a language that
> makes an immutable and mutable world coexist. Yet the implementation
> doesn't back that up.
>
> So why should we probably finish fixing up const, over say the multiple
> alias this, @safe, or no GC use? Because it is what will be touched by
> new users the most. You tell people how great mixing immutable and
> mutable is, they're going to give it a try. You pull users over from C++
> or other languages with non-transitive const, they are going to use
> const as they do in that language without reading about how D does it.
> These people aren't going to be using const correctly in D, they
> couldn't possibly know how to. When they complain, we explain what is
> wrong and how they should be using it, but when they do start using it
> correctly (because they won't listen to our "don't use const yet"
> message) they will still fail to get it right because implementation
> doesn't support it.
>
> We need to be able to prove transitive const is easy to work with and
> worth it. Transitive const is hard to see how it works, but no GC and
> explaining multiple alias this is simple to understand. And @safe D is
> not what brings people to D.

Actually my experience is that new users try very early advanced 
examples all over the map. Some indeed try const. Some others try 
interfaces with contract. Some others try concurrency. Some others try 
dimensional analysis. And so on - these examples are drawn only from 
vague recent memories.

It took me a while to figure the psychology. I think what happens is 
that someone trying a new language tends to explore "deltas". Nobody is 
interested in stuff that works the same or similarly in D vs. other 
languages. Nobody's like, "hello world works - I'm sold!" Most often 
someone would see an interesting sample and go like, "Hmm, intriguing. I 
wonder how my idea of tweaking /that/ might work."

In brief, similar to my long experience with C++ "if it compiles, 
somebody will have tried it", my experience with being a sort of a PR 
representative for D suggests that "if it makes sense, a n00b will try 
it and expect it to work". Catering to such a demand is quite difficult 
because you need to cover all cases properly, and fail meaningfully 
(i.e. early and with a good diagnostic) if the demand is unreasonable.

(In the category of failing with a good diagnostic - the issue of 
restricted templates comes to mind. If a call doesn't satisfy any 
restricted template, the compiler should specify which part of the 
complex Boolean expression failed, a la:

test.d(24): Error: reduce(x) failed to match any function
test.d(24): Remark: Candidate std.result failed because 
isInputRange!(typeof(x)) is false
test.d(24): Remark: isInputRange!(typeof(x)) is false because x.front 
does not exist

)

> There was a concentration on TDPL bugs before the book came out, lets
> bring that back and get them done for 2.058:
> http://d.puremagic.com/issues/buglist.cgi?query_format=advanced&short_desc=tdpl&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&short_desc_type=allwordssubstr
>
>
> What do you say team?

We have indeed identified TDPL alignment an important strategic 
objective. There are more (and more important) bugs than those you 
linked, but I haven't found the time yet to make a pass through them.


Andrei


More information about the Digitalmars-d mailing list