Why is `scope` planned for deprecation?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Nov 12 14:33:04 PST 2014


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