Old Quora post: D vs Go vs Rust by Andrei Alexandrescu

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Fri Jan 5 00:58:12 UTC 2018


On Thursday, 4 January 2018 at 20:25:17 UTC, jmh530 wrote:
> That probably makes Pony easier to compare to D. I was just 
> noting that Rust shares some ownership stuff with Pony.

I get your point. Pony is probably closer to Go and Erlang, but 
nevertheless comparable to what some want from D based on what 
they say in the forums at least.

> I suppose I'm curious what is the bare minimum that needs to 
> get added to D to enjoy the benefits of an ownership system 
> (and it seemed like something like the iso type was most 
> important).

There should at least be a strategy for having transitions 
between pointer types and tracking of pointer types in relation 
to compile time code gen and run-time behaviour.  So knowing that 
a pointer is iso can allow many things like transitioning into 
immutable, automatic deallocation, reusing memory without 
realloction, moving heap allocations to the stack…

But if D is going to have a GC and no special code-gen to back it 
up then it becomes important to stratify/segment the memory into 
regions where you know that pointers that cross boundaries are 
limited to something known, so that you can scan less during 
collection. Which is rather advanced, in the general case, IMO. 
But a possibility if you impose some restrictions/idioms on the 
programmer.



More information about the Digitalmars-d mailing list