Future of memory management in D

Paulo Pinto pjmlp at progtools.org
Wed Nov 17 06:45:25 UTC 2021


On Wednesday, 17 November 2021 at 02:10:02 UTC, jmh530 wrote:
> On Tuesday, 16 November 2021 at 22:38:13 UTC, IGotD- wrote:
>> [snip]
>>
>> The Achilles heel of D and its memory management was never the 
>> GC itself or GC/not GC. It was that D didn't separate raw 
>> pointers from managed pointers as different types. If D had 
>> done that, it would have many more options.
>>
>> This borrow checker implementation in D, I'm not sure what the 
>> purpose is and I don't have the whole picture either.
>
> I'm confused by this because it seems as if the managed C++ 
> iterations from Microsoft do not have much traction. What is 
> the benefit of different types for GC/non-GC pointers?

They do, to the point that C++/CLI support was a major milestone 
for .NET Core 3.0.

C++/CLI is used on the context of native interop, its goal isn't 
to rewrite the world in C++, and is much easier than figuring out 
the right set of P/Invoke declarations.

And then since Longhorn debacle, Windows team has pushed COM 
everywhere as replacement for .NET ideas, so you have COM 
reference counting across all OS stack.

What we don't have is a developer friendly way to author COM, 
because politics killed C++/CX and we are back into editing IDL 
files, but AddRef/Release are everywhere.


More information about the Digitalmars-d mailing list