[Dlang-study] [lifetime] Let's focus on escape analysis

Andrei Alexandrescu andrei at erdani.com
Mon Nov 2 08:03:04 PST 2015


On 11/02/2015 07:49 AM, Marc Schütz wrote:
> I can see complexity in three forms:
>
> 1.) Complexity of the concept
>
> A system equivalent to Rust's
[snip]

I don't follow Rust much, but my perception from following the trade 
news is that since launched it has scored a few victories (an OS 
project, a safe Doom implementation) but by and large the excitement has 
subsided after the pre-release excitement gave way to the post-1.0 
certainty. The status seems to be - things aren't as great as they were 
cracked to be. Putting ownership front and center just makes things 
difficult, often for no good outcome.

(Our dmd downloads dropped strongly after the 1.0 announcement (May 15, 
2015), but then they climbed back 
(http://erdani.com/d/downloads.daily.png).)

Do we have someone following Rust closely?

Let me add that D is already a large language - much larger that "Rust 
minus ownership"; it is my opinion that adding anything as involved as 
Rust's ownership to today's D, it will just crumble under its own 
weight. Of course I'm willing to change this opinion with good arguments 
and evidence.

> Maybe there is a way to get the same guarantees that Rust provides by
> adding some additional restrictions that would enable both the
> implementation and the concept to be easier to understand? Or attacking
> the problem from a different angle, could we cut back on the guarantees
> (making some corner cases unsafe) to reduce the complexity?

That's my hope. There has been a lot of recent work on reference 
counting (ARC, Petrank et al, Blackburn et al) that is very very 
compelling. I also believe we can creatively do new things, too, in 
addition to integrating such recent work.

> There's also the question whether we want to integrate the related topic
> of uniqueness at the same time.

I'd be fine with some restricted form of uniqueness - e.g. have a "box" 
that carries a unique value or null, and can be opened only destructively.

Also, there's the dynamic check for uniqueness that can be done with RC.



Andrei


More information about the Dlang-study mailing list