[Dlang-internal] DIP1000 discussion and testing
Mathias Lang via Dlang-internal
dlang-internal at puremagic.com
Thu Dec 22 06:49:02 PST 2016
On Sunday, 18 December 2016 at 17:56:26 UTC, Walter Bright wrote:
> On 12/18/2016 9:28 AM, Martin Nowak wrote:
>> Let me suggest a reason, transitive scope checking would be
>> more complex
>> to implement, is it that?
>
> It's a heluva lot more complicated for the user. And since it
> is not necessary, why pay such a large bill?
>
>
>> - How certain are we that this is enough? In other words, why
>> is `tmp =
>> &a.b; tmp2 = &tmp.c; tmp2.d.e` not necessary.
>
> It would be necessary in order to build non-trivial data
> structures on the stack. How necessary is that? I've never
> needed to in decades of programming. I don't think there are
> any instances in Phobos or dmd.
>
> If one really wants to do that, there's always @system code.
>
> Is it worth burdening everything with a feature when the use
> case for it is rare? I don't think so.
>
> For example, consider 'volatile' in C++. The use case for it is
> rare (very rare). But there's an enormous amount of spec
> verbiage and thought dedicated to how to weave it into the type
> system, overloading rules, conversion rules, casting rules,
> promotion rules, mangling rules, deduction rules, on and on.
> It's just not worth it.
>
>
>> - Let's imagine for a short moment, what it would mean to make
>> scope
>> transitive at a later point, if we'd ever find enough reasons
>> to do so.
>> Maximizing future options is always good.
>
> This kind of annotation system was first proposed 10 years ago.
> I've been thinking about how to make it simpler ever since, and
> the original has not improved with age.
>
> I also have a lot of experience with transitive const, and how
> disruptive that was, and how many years it took to work the
> problems out (Andrei says they're still a problem).
Thank you so much for this explanation.
It clears up many of the points on which I had questions.
Once I run out of simple test cases, I'll try to toy around with
a more advanced RefCounted design.
More information about the Dlang-internal
mailing list