More on Rust language

Paulo Pinto via Digitalmars-d digitalmars-d at puremagic.com
Thu May 8 23:38:22 PDT 2014


On Friday, 9 May 2014 at 04:55:28 UTC, Caligo via Digitalmars-d 
wrote:
> On Thu, Nov 3, 2011 at 10:43 PM, Walter Bright
> <newshound2 at digitalmars.com>wrote:
>
>>
>>  How do you implement a moving GC in D if D has
>>> raw pointers?
>>>
>>
>> It can be done if the D compiler emits full runtime type info. 
>> It's a
>> solved problem with GCs.
>>
>>
>>  D semantics doesn't allow the GC to automatically modify those
>>> pointers when the GC moves the data.
>>>
>>
>> Yes, it does. I've implemented a moving collector before 
>> designing D, and
>> I carefully defined the semantics so that it could be done for 
>> D.
>>
>> Besides, having two pointer types in D would be disastrously 
>> complex.
>> C++/CLI does, and C++/CLI is a failure in the marketplace. 
>> (I've dealt with
>> multiple pointer types from the DOS daze, and believe me it is 
>> a BAD BAD
>> BAD idea.)
>>
>
>  Given the recent discussion on radical changes to GC and 
> dtors, could
> someone please explain why having multiple pointer types is a 
> bad idea?

It increases the complexity to reason about code.

If the compiler does not give an helping hand, bugs are too easy 
to create.

--
Paulo


More information about the Digitalmars-d mailing list