Why is `scope` planned for deprecation?

Manu via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 13 01:29:14 PST 2014


Are you guys saying you don't feel this proposal is practical?
http://wiki.dlang.org/User:Schuetzm/scope

I think it's a very interesting approach, and comes from a practical
point of view. It solves the long-standings issues, like scope return
values, in a very creative way.

On 13 November 2014 08:33, Andrei Alexandrescu via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On 11/12/14 2:10 PM, deadalnix wrote:
>>
>> On Wednesday, 12 November 2014 at 15:57:18 UTC, Nick Treleaven
>> wrote:
>>>
>>> I think Rust's lifetimes would be a huge change if ported to D. In
>>> Rust user types often need annotations as well as function parameters.
>>> People tend to want Rust's guarantees without the limitations. I think
>>> D does need some kind of scope attribute verification, but we need to
>>> throw out some of the guarantees Rust makes to get an appropriate fit
>>> for existing D code.
>>>
>>
>> Rust is not the first language going that road. The problem is
>> that you get great complexity if you don't want to be too
>> limiting in what you can do. This complexity ultimately ends up
>> costing more than what you gain.
>>
>> I think the sane road to go into is supporting
>> ownership/burrowing for common cases, and fallback on the GC, or
>> unsafe construct for the rest.
>>
>> One have to admit there is no silver bullet, and shoehorning
>> everything in the same solution is not gonna work.
>
>
> I agree. This is one of those cases in which a good engineering solution may
> be a lot better than the "perfect" solution (and linear types are not even
> perfect...).
>
> Andrei


More information about the Digitalmars-d mailing list