Borrow Checking and Ownership Transfer

Paulo Pinto pjmlp at progtools.org
Sun May 18 07:06:24 UTC 2025


On Sunday, 18 May 2025 at 05:15:02 UTC, Araq wrote:
> On Sunday, 18 May 2025 at 03:34:43 UTC, Walter Bright wrote:
>> On 5/12/2025 11:21 PM, Paulo Pinto wrote:
>>> On Monday, 12 May 2025 at 21:38:28 UTC, Walter Bright wrote:
>>>> It never made it into the C++ Standard, and its only use is 
>>>> CLI.
>>> 
>>> So what.
>>
>> Why wouldn't a GC pointer be of general utility in C++?
>
> The GC pointer in C++ is called shared_ptr and it was 
> considered to be of general utility... But .NET comes with its 
> own GC based on tracing, not on reference counting and thus 
> they added a pointer type for this. This is just some very 
> basic good design, stop acting like multiple pointer types are 
> somehow a "failed experiment", it's ridiculous.

Exactly, one can start discussing language semantics of what is a 
GC pointer, and as anyone with formal background in compiler 
development theory knows, any form of automatic resource 
management is.

Pointing out it is a failure, when market segments bigger that 
the whole industrial adoption of D are using them is hardly a 
failure, and does very little to make D more appealing for 
adoption.

By the way, Apple is adding new pointer types into clang, for 
safer C and C++ code and also safer interop with Swift, basically 
their own flavour of C++/CLI.

See EuroLLVM 2025 talks.


More information about the Digitalmars-d mailing list