Why does D rely on a GC?

Idan Arye via Digitalmars-d digitalmars-d at puremagic.com
Mon Aug 18 17:08:07 PDT 2014


On Monday, 18 August 2014 at 23:48:24 UTC, Ary Borenszweig wrote:
> On 8/18/14, 8:51 AM, bearophile wrote:
>> Jonathan M Davis:
>>
>>> The biggest reason is memory safety. With a GC, it's possible 
>>> to make
>>> compiler guarantees about memory safety, whereas with
>>> manual memory management, it isn't.
>>
>> Unless you have a very smart type system and you accept some 
>> compromises
>> (Rust also uses a reference counter some some cases, but I 
>> think most
>> allocations don't need it).
>>
>> Bye,
>> bearophile
>
> It's very smart, yes. But it takes half an hour to compile the 
> compiler itself. And you have to put all those unwrap and types 
> everywhere, I don't think it's fun or productive that way.

Initially all those type wrapping and scoping and lifetimes were 
single-character annotations and that gave me the impression that 
the idea is that once you get comfortable with Rust's type system 
and syntax, you can use all that fine-grained control over the 
scope and lifetime of the data to get superior compile-time error 
checking and to give better cues to the compiler to get better 
performance, without too much effort and without hindering the 
readability(again - once you get comfortable with the type 
system).

Now, though, when they remove more and more syntax to the library 
in an attempt to reach the elegance and simplicity of modern C++, 
I'm no longer sure that was the true goal of that language...


More information about the Digitalmars-d mailing list