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
<newshou...@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

Reply via email to